Viceroyalty of Peru on July 21, 1821. The independence of Peru was proclaimed on July 28, 1821. Viceroy José de la Serna e Hinojosa, still in command of a sizable military force, retired to Jauja, and later to Cusco. On July 26, 1822, San Martín and Simón Bolívar met in Guayaquil to define a strategy for the liberation of the rest of Peru. The meeting was secret, and exactly what occurred is not known. However, afterwards San Martín returned to Argentina while Bolívar prepared to launch an offensive against the remaining royalist forces in Peru and Upper Peru (Bolivia). In September 1823 Bolívar
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