In 1814, Antonio José de Sucre joined the fight for South American independence from Spain. The
Battle of Pichincha took place on 24 May 1822, on the slopes of the
Pichincha volcano, near
Quito in what is now
Ecuador. The encounter, fought in the context of the
Spanish American wars of independence, pitted a Patriot army under Sucre against a Royalist army commanded by Field Marshal
Melchor Aymerich. The defeat of the Royalist forces brought about the liberation of Quito and secured the independence of the provinces belonging to the
Real Audiencia de Quito, or
Presidencia de Quito, the Spanish colonial administrative jurisdiction from which the
Republic of Ecuador would eventually emerge. As of late 1824,
Royalists still had control of most of southern
Peru as well as
Real Felipe Fort in the port of
Callao. On 9 December 1824, the
Battle of Ayacucho took place at Pampa de La Quinua, near the town of
Quinua, between Royalist and Patriot forces. Sucre, as
Simón Bolívar's lieutenant, led the Patriot forces to victory over the
Viceroy José de la Serna, who was wounded. After the battle, second commander-in-chief
José de Canterac signed the final capitulation of the Royalist army on his behalf. As a result, he was promoted, at the request of the Peruvian Congress, to
Marshal and as
General in Chief by the Colombian legislature. . After the victory at Ayacucho, following precise orders from Bolívar, Sucre, nominated as Ayacucho's Grand Marshal, entered
Upper Peru (known today as
Bolivia) territory on 25 February 1825. Besides having orders of installing an immediately independent administration, his role was limited to giving an appearance of legality to the process that Upper Peruvians themselves had begun already. Royalist general
Pedro Antonio Olañeta stayed in
Potosí, where he received by January the "Union" Infantry Battalion coming from
Puno under the command of colonel
José María Valdez. Olañeta then summoned a War Council, which agreed to continue the resistance in the name of Ferdinand VII. Next, Olañeta distributed his troops between
Cotagaita fortress with the "Chichas" Battalion. in charge of colonel Medinacelli, while Valdez was sent to
Chuquisaca with the "Union" Infantry Battalion and loyalist militias, and Olañeta himself marched toward
Vitichi, with 60,000 pieces of gold from the Coin House in Potosí. But for the Spanish military personnel in Upper Peru, it was too little too late, as since 1821 all out guerilla warfare had raged in this part of the continent. However, in
Cochabamba the First Battalion of the Infantry Regiment "Ferdinand VII", led by colonel José Martínez, rebelled and sided with the independence movement, only to be followed later by the Second Battalion, "Ferdinand VII" Infantry Regiment in
Vallegrande, resulting in the forced resignation of Brigadier Francisco Aguilera on 12 February. Royalist colonel José Manuel Mercado occupied
Santa Cruz de la Sierra on 14 February, as
Chayanta stayed in the hands of lieutenant colonel Pedro Arraya, with the cavalry squadrons "Santa Victoria" (Holy Victory) and "Dragones Americanos" (American Dragoons), and in Chuquisaca the cavalry squadron "Dragones de la Frontera"(Frontier Dragoons) under colonel Francisco López claimed victory for the independence forces on 22 February. At this point, the majority of royalist troops of Upper Peru refused to continue fighting against the powerful army of Sucre and switched allegiances. Colonel Medinacelli with 300 soldiers also revolted against Olañeta, and on 2 April 1825 they faced each other in the
Battle of Tumusla, which ended with the death of Olañeta. A few days later, on 7 April, general José Mario Valdez surrendered in
Chequelte to general Urdininea, putting an end to the war in Upper Peru and signalling victory to the local independence movement which had been active since 1811. == Role in the foundation of Bolivia ==