Peru Antonio José de Sucre they defeated the larger Spanish army in the Battle of Junín on 6 August 1824 and the decisive Battle of Ayacucho on 9 December of the same year, consolidating the independence of Peru and Alto Peru. Alto Peru was later established as Bolivia. During the early years of the Republic, endemic struggles for power between military leaders caused political instability. From the 1840s to the 1860s, Peru enjoyed a period of stability under the presidency of Ramón Castilla, through increased state revenues from guano exports. However, by the 1870s, these resources had been depleted, the country
First Upper Peru campaign decline, mainly due to the favourable treatment of natives and the determined opposition of the church, which attacked Castelli through his secretary Bernardo Monteagudo and his public atheism. Both royalists in Lima and Saavedra in Buenos Aires compared them both with Maximilien Robespierre, leader of the Reign of Terror of the French Revolution. Castelli also abolished the mita in Upper Peru, a project that was shared by Mariano Moreno, but Moreno had been removed from the Junta by this point. Without Castelli being in Buenos Aires to mediate between them, the disputes between Moreno and Saavedra had worsened. The Junta