Bolivian War of Independence

The Bolivian war of independence began in 1809 with the establishment of the Government Juntas in Sucre and La Paz, after the Chuquisaca Revolution and La Paz revolution. Those Juntas were defeated shortly after, and the cities fell again under Spanish control. The May Revolution of 1810 ousted the viceroy in Buenos Aires, which established its own Junta. Buenos Aires sent three military campaigns to the Upper Peru, headed by Juan José Castelli, Manuel Belgrano and José Rondeau, but the royalists ultimately prevailed over each one. However, the conflict grew into a guerrilla war, the War of the Republiquetas, preventing the royalists from strengthening their presence. Simón Bolívar and Antonio José de Sucre defeated the royalists at northern South America, and Sucre led the campaign that defeated the royalists for good. Bolivian independence was proclaimed on August 6 of 1825.

The juntas of 1809
During the Peninsular War which took place in Spain, Upper Peru (today Bolivia) closely followed the reports that arrived describing the rapidly evolving political situation in Spain, which led the Peninsula to near anarchy. The sense of uncertainty was heightened by the fact that news of the March 17 Mutiny of Aranjuez and the May 6 abdication of Ferdinand VII in favor of Joseph Bonaparte arrived within a month of each other, on August 21 and September 17, respectively. In the confusion that followed, various juntas in Spain and Portuguese Princess Carlotta, sister of Ferdinand VII, in Brazil claimed authority over the Americas.

On November 11, the representative of the Junta of Seville, José Manuel de Goyeneche, arrived in Chuquisaca, after stopping in Buenos Aires, with instructions to secure Upper Peru's recognition of authority of the Seville Junta. He also brought with him a letter from Princess Carlotta requesting the recognition of her right to rule in her brother's absence. The President-Intendant Ramón García León de Pizarro, backed by the Archbishop of Chuquisaca Benito María de Moxó y Francolí, was inclined to recognize the Seville Junta, but the mostly Peninsular Audiencia of Charcas, in its function as a privy council for the President (the real acuerdo), felt it would be hasty to recognize either one. A fist fight almost broke between the senior oidor and Goyeneche over the issue, but the oidores' opinion prevailed. Over the next few weeks García León and Moxó became convinced that recognizing Carlotta might be the best way to preserve the unity of the empire, but this was unpopular with the majority of Upper Peruvians and the Audiencia. Over the next few months the President and the Archbishop became more unpopular.

On May 26, 1809, the Audiencia oidores received rumors that García León de Pizarro planned to arrest them in order to recognize Carlotta. The Audiencia decided that the situation had become so anarchic both in Upper Peru and in the Peninsula, that Upper Peru needed to take the government into its own hands. It removed García León de Pizarro from office and transformed itself into a junta, which ruled in Fernando's name, just as cities and provinces had done in Spain a year earlier. A second junta was established in La Paz on July 16 by Criollos who took over the local barracks and deposed both the intendant and bishop of La Paz. The La Paz junta clearly broke with any authority in Spain and with the authorities in Buenos Aires. These two juntas failed to consolidate a solid following in all of Upper Peru and were defeated by October 1809 by two armies sent by the viceroys of Lima and Buenos Aires, José Fernando de Abascal and Baltasar Hidalgo de Cisneros. After Buenos Aires successfully established a junta in May 1810, Upper Peru came under the control of the Viceroyalty of Peru and managed to fight off several attempts by to take over it militarily.

The republiquetas
From 1810 to 1824, the idea of independence was kept alive by six guerrilla bands that formed in the backcountry of Upper Peru. The areas they controlled are called republiquetas ("petty republics") in the historiography of Bolivia. The republiquetas were located in the Lake Titicaca region, Mizque, Vallegrande, Ayopaya, the countryside around Sucre, the southern region near today's Argentina and Santa Cruz de la Sierra. The republiquetas were led by caudillos whose power was based on their personality and ability to win military engagements. This allowed them to create quasi-states which attracted varied followers, ranging from political exiles of the main urban centers to cattle rustlers and other fringe members of Criollo and Mestizo society. These Criollo and Mestizo republiquetas often allied themselves with the local Indian communities, although it was not always possible to keep the Natives' loyalty, since their own material and political interests often eclipsed the idea of regional independence. Ultimately the republiquetas never had the size nor organization to actually bring about the independence of Upper Peru, but instead maintained a fifteen-year stalemate with royalist regions, while holding off attempts by Buenos Aires to control the area.

The areas of Upper Peru which remained under royalist control elected a representative to the Spanish Cortes, Mariano Rodríguez Olmedo, who served from May 4, 1813, to May 5, 1814. Rodríguez Olmedo was a conservative representative, signing the 1814 request, known as the "Manifesto of the Persians" ("Manifiesto de los Persas"), by seventy Cortes delegates to Ferdinand VII to repeal the Spanish Constitution of 1812.

Independence consolidated
The fight for independence gained new impetus after the December 9, 1824, Battle of Ayacucho in which a combined army of 5,700 Gran Colombian and Peruvian troops under the command of Antonio José de Sucre defeated the royalist army of 6,500 and captured its leader, José de la Serna. The Colombians and Peruvians, who had already liberated Ecuador and Peru, tipped the balance of power in favor of the independence forces. After the Battle of Ayacucho, the remaining royalist troops under the command of Pedro Antonio Olañeta—who was opposed to the Constitution and had rebelled in January 1824 against Viceroy La Serna and the liberal restoration of 1820—surrendered after Olañeta died in Tumusla on April 2, 1825. Simón Bolívar, president of Gran Colombia and Peru at the time and Sucre's chief, was opposed to Upper Peruvian independence, but local leaders—both former royalists like Casimiro Olañeta, nephew of General Olañeta, and patriots—all supported it. Bolívar left the decision to Sucre, who went along with local sentiment. Sucre proclaimed Upper Peru's Declaration of Independence in the city which now bears his name on August 6. A constituent congress renamed the country "Bolívar", later changed to Bolívia, on August 11, 1825.

From then on, local elites dominated the congress and although they supported Sucre's efforts, they chafed under the idea that a Gran Colombian army remained in the nation. After an attempt on his life, Sucre resigned the presidency of Bolivia in April 1828 and returned to Venezuela. The Bolivian Congress elected La Paz native Andrés de Santa Cruz the new president. Santa Cruz had been a former royalist officer, served under José de San Martín after 1821 and then under Sucre in Ecuador, and had a short term as president of Peru from 1826 to 1827. Santa Cruz arrived in Bolivia in May 1829 and assumed office. The government was now fully in the hands of locals, opening a new, though equally troubled, era in Bolivian history.