The Peruvian War of Independence was the long struggle that ended Spanish rule over Peru, the last great stronghold of the Spanish Empire in South America. Local risings began in 1811, but the decisive phase opened in 1820, when José de San Martín landed an army from Chile, and closed in December 1824, when Antonio José de Sucre destroyed the royalist army at Ayacucho. Because Peru was the royalist base for the whole continent, its liberation brought the Spanish American wars of independence on the mainland to an end.
A royalist fortress
The Viceroyalty of Peru, governed from Lima, had been the heart of Spanish South America since the 16th century. Its merchant houses lived off the silver trade and the Spanish commercial system, and its creole elite had little appetite for the risks of revolution. Memories of the rebellion of Túpac Amaru II in 1780–1781, a mass Indigenous rising crushed with great bloodshed, made many landowners fear what a war might unleash.
When Napoleon forced the Spanish Bourbons to abdicate in 1808 and the Peninsular War began, juntas sprang up across Spanish America. Peru went the other way. Viceroy José Fernando de Abascal raised armies, annexed Upper Peru to his viceroyalty and used Lima as the base for campaigns against the rebels of the Río de la Plata, Chile and Quito. Rebellions inside Peru were small and short: Francisco Antonio de Zela's rising at Tacna in 1811, a revolt around Huánuco in 1812, and the larger Cuzco rebellion of 1814–1815, in which creole conspirators enlisted the Indigenous noble Mateo Pumacahua, then in his seventies. Royal troops and loyal Indigenous chiefs crushed it, and Pumacahua was executed.
San Martín's expedition
The threat came from outside. After winning Chile's independence at Chacabuco and the Battle of Maipú in 1818, the Argentine general José de San Martín prepared to strike at Lima by sea. A Chilean navy built under Manuel Blanco Encalada and commanded by the British officer Thomas Cochrane raided the coast and Spanish shipping. In August 1820 the Liberating Expedition, a little over 4,000 soldiers, sailed from Valparaíso and landed at Pisco, south of Lima, in early September.
San Martín avoided a pitched battle. He negotiated with Viceroy Joaquín de la Pezuela and later with José de la Serna, whose officers deposed Pezuela in January 1821 and made him viceroy, but the talks failed because he would accept nothing less than full independence. Meanwhile his forces cut Lima off and won over coastal towns. On 6 July 1821 the royalists abandoned the capital and withdrew into the highlands. San Martín entered Lima days later and proclaimed independence in the main square on 28 July 1821, taking the title Protector of Peru.
Stalemate and the Guayaquil meeting
Independence in Lima was not victory. La Serna's army in the sierra was roughly twice the size of San Martín's, and it controlled the silver mines and the Indigenous highlands. The Protector's caution, his illness and his preference for a constitutional monarchy under a European prince made him enemies, and Cochrane quarrelled with him over pay and sailed off. In July 1822 San Martín met Simón Bolívar at Guayaquil. What passed between them in private is still debated, but San Martín came away convinced that only Bolívar could finish the war. He resigned and left Peru in September 1822.
The months that followed were a run of disasters. Royalist forces had already won at Ica in April 1822, and they won again at Torata and Moquegua in January 1823. Under President José de la Riva-Agüero the patriots lost battle after battle, and rival factions, one of them backing the Marquis of Torre Tagle, split their camp. On 18 June 1823 the royalist general José de Canterac walked back into Lima unopposed. The Congress appealed to Bolívar, who landed at Callao on 1 September 1823.
Junín and Ayacucho
Bolívar rebuilt the army in the north with troops from Gran Colombia and Peru. His chance came in 1824, when a revolt by the royalist commander Pedro Antonio de Olañeta in Upper Peru divided the Spanish forces. On 6 August 1824 Bolívar's cavalry defeated the royalist horsemen in a short, fierce cavalry fight on the high plain of Junín. Bolívar then handed field command to Antonio José de Sucre, partly because the Colombian Congress, at Vice-President Santander's urging, had stripped him of command of its troops in Peru.
La Serna marched out of Cuzco in October and spent weeks trying to outflank Sucre. The patriots fell back towards Huamanga, and at the Corpahuaico ravine only a stubborn rearguard of Colombian rifles saved their army. On 9 December 1824 the two armies met on the plain of Ayacucho, hemmed in by ravines and mountains. The royalists, about 9,000 strong, held the heights and had more guns; Sucre had about 6,000. A royalist attack on the patriot right was thrown back, Sucre's counterattack and reserve broke the royalist right, and La Serna was captured. The royalists lost about 1,400 dead; patriot losses were about 370 killed. The details are on our page on the Battle of Ayacucho.
Surrender and the last holdouts
That same day Canterac signed a capitulation with Sucre under which the rest of the royalist army laid down its arms. Garrisons in the sierra and Lima followed. Sucre then marched into Upper Peru, where Olañeta's forces were overcome and the campaign ended in April 1825; the new republic there took the name Bolivia in Bolívar's honour. The last Spanish flag in Peru flew over the Real Felipe fortress at Callao, whose garrison held out until January 1826.
Many royalist families left or were expelled.
A contested independence
Peruvian historians have long argued over how far independence was won by Peruvians and how far it was imposed by armies from Argentina, Chile and Colombia. The war was also a civil war: the royal army in Peru was overwhelmingly recruited in the Americas, with soldiers born in Spain making up only about 15 per cent of its ranks. Bolívar's dominance in Lima left resentment of Colombian influence, and the border between Peru and Gran Colombia was fought over within a few years. Peru still celebrates 28 July as its national day, while Ayacucho is remembered across Spanish America as the battle that ended three centuries of Spanish rule.
On our maps
Our map for 1815 shows Lima, Cuzco, Ayacucho and La Paz all inside the Viceroyalty of Peru, the royalist bloc that the patriots had to break. By the 1878 map the same ground is divided between the republics of Peru and Bolivia.
Key dates
- 1811Francisco Antonio de Zela leads a short-lived rising at Tacna in the far south.
- 1814A junta takes power in Cuzco on 3 August and recruits the elderly chief Mateo Pumacahua.
- 1815Royalist troops crush the Cuzco rebellion, and Pumacahua is executed.
- 1820San Martín's expedition sails from Valparaíso in August and lands at Pisco in September.
- 1821Royalist troops leave Lima on 6 July, and San Martín proclaims independence there on 28 July.
- 1822San Martín meets Bolívar at Guayaquil in late July and leaves Peru in September.
- 1823Canterac's royalists reoccupy Lima without a fight on 18 June.
- 1823Bolívar lands at Callao on 1 September at the request of the Peruvian Congress.
- 1824Bolívar's cavalry wins at Junín on 6 August.
- 1824Sucre destroys the royalist army at Ayacucho on 9 December and captures Viceroy La Serna.
- 1825Sucre's campaign in Upper Peru ends in April, and the region becomes Bolivia.
- 1826The last Spanish garrison, in the fortress of Real Felipe at Callao, surrenders in January.
From the atlas
Peruvian War of Independence in time and on the map
Peruvian War of Independence lasted from 1821 to 1824. The nearest maps from before and after are 1815 and 1878; compare them side by side.
Living through it, among others on this site: Aaron Burr (1756–1836), Abraham Lincoln (1809–1865), Adolphe Thiers (1797–1877), Adrien-Marie Legendre (1752–1833), Alessandro Volta (1745–1827), Alexander I of Russia (1777–1825), Alexis de Tocqueville (1805–1859), Andrew Jackson (1767–1845), Andrew Johnson (1808–1875) and Antonio José de Sucre (1795–1830).
Other events of the same years: Little Ice Age (1303–1850), Ottoman–Persian Wars (1514–1823), Russo-Turkish wars (1568–1918), American Indian Wars (1622–1924), Sakoku (1639–1854), Fula jihads (1725–1860), Indian independence movement (1757–1947), Caucasian War (1763–1864), Xhosa Wars (1779–1879) and Australian frontier wars (1794–1899).
Next to it in time on this site: before, Adams–Onís Treaty (1821) and Greek War of Independence (1821–1829); after, Independence of Brazil (1822) and Anglo-Ashanti wars (1823–1900).
Quick answers
- When did Peruvian War of Independence happen?
- It began in 1821 and ended in 1824, lasting 3 years.
- Where did Peruvian War of Independence take place?
- Viceroyalty of Peru.
- How did the map change?
- Compare the atlas’s maps of 1815 and 1878 side by side.
- Why did Peru stay loyal to Spain longer than its neighbours?
- Lima was the seat of the richest viceroyalty in South America, and its merchants and officials depended on the Spanish trading system. Viceroy José Fernando de Abascal turned Peru into the base from which royalist armies were sent against rebels in Upper Peru, Chile and Quito. The memory of the violent Túpac Amaru II uprising of 1780–1781 also made many creoles wary of upheaval from below.
- Why did San Martín leave Peru before the war was won?
- After proclaiming independence in 1821 he could not defeat the royalist army in the highlands, which was much larger than his own. He was ill, criticised for his caution and opposed for favouring a constitutional monarchy. After meeting Bolívar at Guayaquil in July 1822 he resigned his posts and left the final campaign to Bolívar's army.
- How many soldiers fought at Ayacucho?
- Modern reference works put the royalists at about 9,000 men and Sucre's army at about 6,000, though older accounts credit the viceroy with up to 13,000. The royalists lost about 1,400 dead; the patriots lost about 370 killed and some 900 casualties in all.
- What happened to the royalist soldiers after Ayacucho?
- On the evening of the battle the rest of La Serna's army surrendered under a capitulation signed by Canterac and Sucre. Garrisons in the sierra and Lima gave up soon after, but a diehard force held the Real Felipe fortress at Callao until January 1826.