Bolivia's independence was definitively proclaimed on 6 August 1825 at a congress held in Chuquisaca.
While the Gran Colombian troops disembarked in the port of Callao under the command of General Antonio José de Sucre, General Andrés de Santa Cruz—who until a short time before had been fighting in the ranks of the realistas (Spanish loyalists)—arrived to share the libertarian ideas of José de San Martín and was sent to augment Sucre's troops, beginning their march toward Upper Peru. In August 1823, they entered the city of La Paz and, forced to wage battle, Santa Cruz emerged victorious from the Battle of Zepita on 25 August 1823 against one of General Valdez's divisions.
Between the years of 1822 and 1823, the situation in Peru had turned chaotic: the armies had been defeated by the realistas and politics had plunged into anarchy. It was with these lamentable conditions that Simón Bolívar was confronted when on 1 September 1823 he arrived in Lima. The congress gave him charge of the military.
The situation could not have been more sober for the patriots. The independence of Peru was not assured, and on 29 February 1824 the realistas once again succeeded in occupying Lima. But this time, the political upheavals taking place in Spain spelled the final disintegration of the Spanish troops in America.
General Pedro Antonio Olañeta, a recalcitrant absolute monarchist, rebelled against the viceroy La Serna (who himself had liberal and constitutionalist tendencies) because he attributed to him the desire to separate from the monarchy and liberate Peru from the absolute rule that Olañeta wanted to impose.
Bolívar met the divided realistas and quickly organized an army made up of Colombians, Argentines, and Peruvians. With this army, on 6 August 1824 he defeated the Spanish Army led by General José de Canterac and Colonel Manuel Isidoro Suárez on the fields of Junín. This victory represented above all the first step to the final triumph in the Battle of Ayacucho. The Spanish commanders—Canterac, Váldés, and de la Serna—reassembled in Cuzco and decided to reorganize their forces and flee before the victors of Junín.
Battle of Ayacucho and the Arrival of Sucre in Upper Peru
Charged by Bolívar, Sucre decided to continue his military campaign in Peru. On 9 December 1824, the independents triumphed in a spectacular victory on the plain of Ayacucho. The "Independence of Peru and America" was recognized with the capitulation of the viceroy La Serna. In response to the victory won in Ayacucho, he was later promoted, at the request of the Peruvian Congress, to Marshal and as General in Chief by the Colombian legislature. Bolívar later assigned him the mission to liberate Upper Peru and install a responsible independent national government. Besides, his role was limited to giving an appearance of legality to the process that Upper Peruvians themselves had begun already. But for the Spanish military personnel in Upper Peru, it was too little too late, as since 1815 (and the War of the Republiquetas in certain parts of Upper Peru), all out guerilla warfare had raged in this part of the continent, with hostilities esclatating since 1821.
In Cochabamba on January 16, a cavalry troop of American Dragoons rose up in rebellion. Colonel José Martínez arrested officials and the governor and then arrived to capture the First Battalion, Infantry Regiment Fernando VII's barracks, convincing the regiment to switch sides. He then asked the Santa Victoria cavalry squadron to stand down at once, leaving the city's entire garrison of 800 men in the hands of the independents. He appointed Mariano Guzmán as governor and before his own resignation, appointed Colonel Saturnino Sánchez, and then swore independence.
Lieutenant Colonel Pedro Arraya and troopers from the Santa Victoria and American Dragoons cavalry squadrons went to Chayanta, where they also pledged their support to the Patriot cause in La Paz.
In Vallegrande, the Second Battalion of the Infantry Regiment Fernando VII (with 200 men) also rebelled, deposing Brigadier General Francisco Javier Aguilera on 26 January. Colonel José Manuel Mercado occupied Santa Cruz de la Sierra on 14 February. Mojos and Chiquitos joined in the rebellion, increasing the ranks of Spanish soldiers who changed their loyalties to the independence movement. As a consequence of these actions, Olañeta abandoned La Paz on 22 January, heading for Potosí.
On 29 January 1825, General José Miguel Lanza (coming from nearby rural zones known as the Republiqueta de Ayopaya) took the city of La Paz and declared the independence of the provinces of Upper Peru. Lanza was named the first president of Upper Peru. On 6 February, Field Marshal Sucre - at the head of the Liberation Army - crossed the Desaguadero River, which was the border with Peru, and entered La Paz the next day.
In Chuquisaca, the "Dragones de la Frontera" Battalion of Colonel Francisco López defected to the independence cause and on 22 February officially declared the city independent.
Royalist general Pedro Antonio Olañeta stayed in Potosí, where he was welcomed late in the month by soldiers of 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, commanded by colonel l Carlos de 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í. Olañeta abandoned Potosí on 28 March, just before the independent vanguard led by Arralla advanced to liberate the rich mining town.
In spite the governor of Salta's (José Antionio Álvarez de Arenales) final orders not to advance, Colonel José María Pérez de Urdininea and 200 dragoons, together with the advance party of the independence forces, surprised the Tupiza garrison on 23 March. 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 and 300 soldiers rebelled against Olañeta on 1 April, the two meeting the next day in the Battle of Tumusla, which culminated with the death of Olañeta. Diverse sources deny the existence of such a battle, arguing that Olañeta died of a single, self-inflicted gunshot. A few days later, on April 7, 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, marking thus the end of more than many years of warfare in South America and the independence of the former Spanish possessions.
On 7 April, Sucre received an official letter sent by Álvarez de Arenales from Mojo (near Tupiza), informing him of the commission he had been given by the government in Buenos Aires on 8 February to treat (negotiate) with the realista leaders in the provinces of Upper Peru to end the war: "...on the basis that they need to remain at complete liberty to agree on what best suits their interests and government."
Sucre arrived at Chuquisaca that April to begin the final preparations for the independence of Upper Peru. On the 25th, the Marshal arrived in the city to a huge crowd of thousands of residents and the academe.