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 decline, mainly due to the favourable treatment of natives and the determined opposition of the church, which attacked Castelli through his secretary Bernardo Monteagudo and his public atheism. Both royalists in Lima and Saavedra in Buenos Aires compared them both with Maximilien Robespierre, leader of the Reign of Terror of the French Revolution. Castelli also abolished the mita in Upper Peru, a project that was shared by Mariano Moreno, but Moreno had been removed from the Junta by this point. Without Castelli being in Buenos Aires to mediate between them, the disputes between Moreno and Saavedra had worsened. The Junta