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,
History of Peru achieved only in the early 1900s. In 1894, Nicolás de Piérola, after allying his party with the Civil Party of Peru to organize guerrilla fighters to occupy Lima, ousted Andrés Avelino Cáceres and once again became president of Peru in 1895. After a brief period in which the military once again controlled the country, civilian rule was permanently established with Pierola's election in 1895. His second term was successfully completed in 1899 and was marked by his reconstruction of a devastated Peru by initiating fiscal, military, religious, and civil reforms. Until the 1920s, this period was called the "Aristocratic Republic",