Gran Colombia–Peru War was the kernel of Bolívar's grander scheme to unite the former Spanish colonies in Central and South America. Prior to becoming the titular head of Gran Colombia, Bolívar had been, briefly, the president of the newly independent state of Bolivia, his namesake. Bolivia had formerly been a part of the Viceroyalty of the "Rio de La Plata", known as Upper Peru, and, once Bolívar relinquished the presidency of Bolivia to his revolutionary compatriot, Antonio José de Sucre Alcalá, in 1826, the Peruvians saw an opportunity. Early in 1828, Peru launched a campaign against Bolivia to reclaim its former territory and
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