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 He planned the reorganization of the Mines of Potosi, and a reform at the University of Charcas. He proclaimed the end of native slavery in the Upper Peru, canceling the tutelage and giving them political rights as neighbors, equal to those of the criollos. He prohibited as well the establishment of new convents and parishes, to avoid the common practice that, under the guise of spreading the Christian doctrine, the natives were forced into servitude by religious orders. He authorized free trade and redistributed land expropriated from the former workers of the mills. The decree was published in Spanish, Guarani,