
Peru was the holdout. While neighboring colonies across South America threw off Spanish rule in the 1810s, the Viceroyalty of Peru remained the empire's most loyal stronghold, its capital Lima serving as the administrative and military nerve center of Spanish power on the continent. It took seventeen years, two foreign liberators, and a final cavalry charge in the Andean highlands before the last Spanish viceroy surrendered. The Peruvian War of Independence, fought from 1809 to 1826, was the longest and most complicated of all the Spanish American independence struggles -- a conflict shaped as much by Peru's internal divisions as by any foreign army.
The roots of Peruvian resistance reached back decades before the formal independence wars began. In 1780, Tupac Amaru II, a descendant of the last Inca emperor, launched a massive uprising against Spanish colonial authorities in the highlands near Cusco. The rebellion was a response to the Bourbon Reforms -- tax increases and administrative changes that squeezed indigenous communities and mestizo merchants alike. It was the first movement in Peru to proclaim the abolition of slavery, and it spread across a vast territory before Spanish forces crushed it with brutal repression. The viceregal authorities executed Tupac Amaru II by quartering in Cusco's main plaza in 1781, a spectacle designed to extinguish any future thoughts of resistance. It did not work. When Napoleon invaded Spain in 1808 and forced the abdication of King Ferdinand VII, the legitimacy of colonial rule cracked across Spanish America. Autonomous juntas emerged in cities throughout the continent, and Peru's turn was coming.
Between 1809 and 1814, Peru's independence movements sputtered. Juntas arose in cities like Tacna, Huanuco, and Cusco, but none gained lasting traction. Lima's merchant class, bound tightly to the Spanish trade monopoly, had little incentive to revolt. Upper Peru -- modern-day Bolivia -- and the southern highlands harbored more radical sentiment, but economic divisions between north and south fragmented the opposition. The Cusco Rebellion of 1814, led by the brothers Jose and Vicente Angulo alongside the indigenous leader Mateo Pumacahua, briefly captured Arequipa and La Paz before royalist forces assembled a devastating counterattack. By 1815, every internal uprising had been crushed. Peru remained firmly in royalist hands, its colonial administration reinforced by regiments from Lima, Arequipa, and fresh expeditionary troops from Spain. The viceroy used Peru as a base to launch campaigns against patriot forces in Chile, Bolivia, and Argentina.
If Peru would not free itself, others would come to do it. Argentine general Jose de San Martin conceived a bold strategy: rather than fighting northward through Upper Peru's mountain passes, he would cross the Andes into Chile, liberate it first, then attack Peru by sea from the west. In January 1817, San Martin led his Army of the Andes across the Cordillera in one of military history's most audacious mountain crossings. Chile fell to the patriots by 1818. On September 8, 1820, San Martin's Liberating Expedition of Peru landed at Paracas on the southern coast. The Sierra Campaign began under General Juan Antonio Alvarez de Arenales, who proclaimed the independence of Ayacucho on November 1, 1820. On July 28, 1821, San Martin declared Peruvian independence in Lima's Plaza Mayor. But declaring independence and achieving it were different matters -- royalist forces still controlled the highlands.
San Martin's position grew untenable. After a famous meeting with Simon Bolivar at Guayaquil in July 1822, San Martin chose to withdraw from Peru, leaving the northern liberator to finish what he had started. Bolivar arrived in Lima in September 1823 and spent months rebuilding the patriot army. The decisive moment came at the Battle of Junin on August 6, 1824, a cavalry engagement fought on the high plains at nearly 13,500 feet -- a battle so swift and fierce that not a single shot was fired, decided entirely by sword and lance. Four months later, on December 9, 1824, General Antonio Jose de Sucre led patriot forces to victory at the Battle of Ayacucho, routing the army of Viceroy Jose de la Serna in the engagement that effectively ended Spanish rule in South America. The last Spanish garrison at Callao's Real Felipe fortress held out until January 1826 before finally surrendering, closing the final chapter of three centuries of colonial rule.
Lima, the center of the independence struggle, sits at 12.06°S, 77.04°W along Peru's central coast. From 5,000-8,000 feet AGL, the colonial center around the Plaza Mayor is identifiable, with the Presidential Palace (formerly the Viceroy's palace) and Lima Cathedral as landmarks. Jorge Chavez International Airport (SPJC/LIM) lies to the northwest in Callao. Key battle sites are spread across the Andes -- Junin at approximately 11.0°S, 76.1°W at 13,500 feet elevation, and Ayacucho at 13.16°S, 74.23°W. Coastal visibility is often limited by marine fog (garua), but highland sites tend to have clear skies.