After The Peruvian War of Independence
Santa Cruz left Peru to govern Bolivia in 1828. Peru was in trouble. Several military rulers vied for power in the Peruvian government. In 1836, Santa Cruz joined Bolivia and Peru in a confederation. Chile feared the power of the new state, so they disturbed the confederation militarily and the union was terminated after the battle of Yungay in 1839. Before Gen. Ramon Castilla became the president, Peru continued to be torn by civil strife. Under Castilla, who was president from 1844 to 1850 and from 1855 to 1863,Peru enjoyed stability and economic development.