Peru proclaimed independence in Lima on 28 July 1821, after the Argentine general José de San Martín arrived by sea with a liberating army. The war ended on 9 December 1824 at the battle of Ayacucho, won by forces under Antonio José de Sucre and backed by Simón Bolívar. Peru's national holidays on 28 and 29 July commemorate the proclamation.
The republic that followed went through military rule, a guano boom, a war with Chile and deep social change in the 20th century.
Why Peru was the last bastion of Spain
Peru was the richest and most loyal part of Spanish America, and for that reason independence came late. When movements in Venezuela, Colombia, Argentina and Chile began to challenge Spain from about 1810, Lima remained a conservative stronghold. The colonial elite of the capital depended on royal institutions, on the silver trade and on the mines. They also feared that a break would unleash the kind of upheaval that Túpac Amaru II had led in 1780.
Local risings did occur before 1820, in places such as Cusco in 1814, but Spanish forces and the viceroy's army repressed them. Many Peruvians, indigenous people and creoles alike, were therefore divided: some fought for the crown, some for the patriots, and many tried to stay out of the war. Historians use the phrase "a liberation imported from outside" to describe the role of the foreign armies, though the picture is more complicated, since Peruvians also took part on both sides.
San Martín and the proclamation of 1821
José de San Martín had freed Argentina's west and Chile before turning to Peru. His army sailed from Valparaíso and landed near Pisco, on the coast now associated with Paracas, in September 1820. Rather than fight a long campaign, he used a combination of pressure, propaganda and negotiation, and the Spanish viceroy withdrew from Lima to the mountains in 1821.
On 28 July 1821, San Martín proclaimed independence in Lima's Plaza Mayor, and he took the title of Protector of Peru. Trujillo and other northern cities had declared for the patriots slightly earlier, in late 1820, which is why the northern city of Trujillo is proud of its own claim. San Martín stayed in Peru for only a year. After a famous meeting with Bolívar at Guayaquil in July 1822, he left the country, and the details of what they said remain a matter of historical debate.
Bolívar, Junín and Ayacucho
Bolívar arrived in 1823, and the war moved to the highlands. The patriot army won the battle of Junín on 6 August 1824, a cavalry clash on a high plateau in the central Andes, and then manoeuvred to confront the royalists near Ayacucho. There, on 9 December 1824, General Antonio José de Sucre commanded the patriot army at the Pampa de la Quinua, and the Spanish viceroy, José de la Serna, was wounded and captured. The capitulation signed afterwards ended Spanish rule on the continent in practical terms.
The battlefield is a short drive from Ayacucho. A large obelisk marks the site, and the village of Quinua nearby is known for ceramics and a small museum. The last Spanish stronghold, the Real Felipe fortress in Callao, held out until January 1826, which shows how long it took for the old order to disappear completely.
The first decades of the republic
The new state began with weak institutions. Bolívar ruled for a short period, and then Peru entered decades of rivalry between military leaders, with frequent changes of government and constitution. The old colonial hierarchies persisted: the vote was restricted, indigenous tribute continued in new forms, and large landowners kept their power. Slavery lasted until 1854, when President Ramón Castilla abolished it, and the same period saw the arrival of Chinese contract labourers on coastal estates, whose influence is still tasted in the country's chifa cooking.
From the 1840s, guano, the seabird droppings used as fertiliser, brought large revenue to the state and fed a brief period of stability and urban building. The boom ended by the 1870s, and the country ran into debt. Lima gained avenues, theatres and the first railways, many of them built in the mountains by famous engineering feats that are still in use.
The War of the Pacific
In 1879, Chile declared war on Peru and Bolivia over the nitrate-rich desert of the south, in what is known as the War of the Pacific. Chilean forces won at sea and on land, and occupied Lima in 1881. Peru lost the province of Tarapacá in the 1883 treaty of Ancón, and the provinces of Tacna and Arica were left under Chilean control for a time. Tacna returned to Peru in 1929, while Arica stayed with Chile.
The war left a deep mark on national memory. The naval hero Miguel Grau, who commanded the ironclad Huáscar, and the officer Francisco Bolognesi, who died defending Arica, are honoured throughout the country, and streets and plazas bear their names. Reconstruction took decades. The war also exposed the weakness of national integration, and it prompted a long debate among Peruvian writers about the place of the Andean majority in the nation, a theme that shaped Peruvian literature.
The twentieth century in brief
In the early 20th century, Lima modernised, mining and export agriculture expanded, and new political movements appeared. Parties such as APRA and the Peruvian Communist Party, along with the indigenista writers and artists, put the situation of rural and indigenous people at the centre of debate. Women gained the vote in 1955, and the vote was extended to people who could not read in 1979.
In 1968, a military government led by General Juan Velasco Alvarado took power and in 1969 launched a large agrarian reform that broke up the haciendas and redistributed land to peasant groups. Between 1980 and 2000 the country went through an internal armed conflict that caused many deaths, especially among rural and Quechua-speaking communities. A national Truth and Reconciliation Commission reported on it in 2003. The period is still discussed in museums, memorials and families, and visitors are best advised to listen carefully and avoid taking sides in casual conversation.
Seeing independence in Lima and beyond
The easiest way to follow the story is through places. In the historic centre of Lima, the Plaza Mayor was the site of the proclamation, and the Government Palace now stands on one side. Museums such as the national museum of archaeology, anthropology and history, and the Museo de Arte de Lima, hold portraits, uniforms and documents from the period; see museums in Peru for the wider picture.
Further out, Ayacucho and the Pampa de la Quinua give the best sense of the final battle, and Callao's Real Felipe fortress shows the last Spanish stand. Independence Day brings parades, a presidential message to Congress on 28 July and public holidays on the 28th and 29th, with crowded transport and fully booked flights, so book travel well ahead for those dates. For earlier context, return to the history overview.
Frequently asked questions
When did Peru become independent?
Independence was proclaimed on 28 July 1821, and it was secured militarily at the battle of Ayacucho on 9 December 1824. Fiestas Patrias are celebrated on 28 and 29 July.
Who was San Martín and why is he honoured in Peru?
José de San Martín was an Argentine general who liberated Chile and then led the army that landed in Peru in 1820. He proclaimed independence in Lima and governed as Protector for about a year. A plaza in the centre of Lima carries his name and a monument to him stands there.
Why do people say Peru was liberated by outsiders?
The armies that decided the war were commanded by San Martín, Bolívar and Sucre, who came from Argentina and Venezuela. Peruvians fought on both sides and local risings occurred, so historians stress that it was a shared and contested process. The question remains part of how Peruvians discuss their history.
Can I visit the battlefield of Ayacucho?
Yes. The Pampa de la Quinua is about a short drive from the city of Ayacucho, with an obelisk and a small museum in the nearby village of Quinua. Visits are often combined with the colonial churches of the city and local crafts.
What was the War of the Pacific?
It was a conflict from 1879 to 1883 in which Chile fought Peru and Bolivia, partly over nitrate deposits. Peru lost Tarapacá and Chilean troops occupied Lima. The war is still part of the national memory, and the heroes Grau and Bolognesi are widely honoured.
What are Fiestas Patrias?
They are the national holidays of 28 and 29 July, marking independence and the armed forces. Expect parades, special menus, school events and crowded buses and flights. Many museums and sites change their hours, so check before planning a visit.
When was slavery abolished in Peru?
Slavery was abolished in 1854 under President Ramón Castilla. Afro-Peruvian communities remained concentrated on the coast, especially south of Lima, and their music and food are an important part of coastal culture today.