Viceroyalty of Peru arrived in Lima with Antonio José de Sucre to plan the offensive. In February 1824 the royalists briefly regained control of Lima. Olañeta's Rebellion started by surprise and the entire royalist army of Upper Peru (today's Bolivia) revolted, led by Pedro Antonio Olañeta (royalist) against La Serna, the viceroy of Peru (a liberal). This broke the royal army and started a civil war in Upper Peru. Having regrouped in Trujillo, Bolívar in June led his rebel forces south to confront the Spanish under Field Marshal José de Canterac. The two armies met on the plains of Junín on August 6,
First Upper Peru campaign to Vieytes, Rodriguez Peña, Larrea and Azcuénaga, asking them to move to the Upper Peru. After the defeat of Goyeneche, they would march back to Buenos Aires. However, the mail was sent by the common postal service, and the postmaster of Córdoba, Jose de Paz, decided to send it instead to Cornelio Saavedra. Besides, the morenist members of the Junta had already been ousted and exiled by that point. The order of the Junta not to proceed to the Viceroyalty of Peru was a de facto truce that would last while not attacking Goyeneche. Castelli tried to turn the situation