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 into a formal agreement, which would imply recognition of the Junta as a legitimate interlocutor. Goyeneche agreed to sign an armistice for 40 days until Lima was issued, and used that time to be strengthened. On 19 June, with the truce still in effect, an advanced royalist troop attacked positions at Juraicoragua. Castelli declared the truce broken and declared war on Peru. The royalist army crossed the Desaguadero on June 20, 1811, starting the Battle of Huaqui. The Army waited near Huaqui, between the plains of Azapanal and Lake Titicaca. The patriotic left wing, commanded by Diaz Velez, faced the