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,
Protectorate of Peru brigadier Mateo Pumacahua, who was curaca of Chinchero, and decades earlier had been instrumental in suppressing the rebellion of Túpac Amaru II. Pumacahua joined the Criollo leaders in forming a junta on August 3 in Cuzco, which demanded the complete implementation of the liberal reforms of the Spanish Constitution of 1812. After some victories in southern Peru and Upper Peru, the rebellion was squashed by mid-1815 when a combined strength of royal forces and loyal curacas, among which were the Catacora and Apo Cari took Cuzco and executed Pumacahua. After the squashing of the aforementioned rebellion, the Viceroy of Peru