Peru's independence was declared by a man who wasn't Peruvian
Every year on July 28, Peru celebrates Fiestas Patrias — the vocabulary for it is covered in the lesson on Fiestas Patrias — marking the date in 1821 when independence was formally proclaimed in Lima's Plaza Mayor. The man who proclaimed it, José de San Martín, was Argentine. The war that actually finished securing that independence three years later was won under the command of Simón Bolívar, who was Venezuelan, and his general Antonio José de Sucre, also Venezuelan. It's a detail that tends to surprise people who assume a country's independence is, by definition, a homegrown movement — Peru's was led, in its decisive military phases, almost entirely by outsiders.
Why Peru lagged behind its neighbors
By the time San Martín proclaimed independence, most of Spanish South America had already been fighting for a decade — the wars had started around 1810 in Buenos Aires, Bogotá, and Caracas. Peru was different: it was the seat of Spanish royal power on the continent, home to the wealthiest colonial elite and the strongest concentration of Spanish military force, and much of Lima's colonial-era establishment had real reasons to prefer the status quo over independence, at least at first. That's a large part of why Peru's independence had to arrive from outside — San Martín's army came north from Argentina and Chile by sea, landing near Pisco in 1820 and advancing on Lima, rather than the movement originating from within Peru's own colonial elite.
A proclamation before a war was won
San Martín entered Lima in July 1821 and proclaimed independence on July 28, 1821, but the royalist Spanish army hadn't been defeated — it had mostly withdrawn into the highlands, where it remained a real military threat for another three years. San Martín governed briefly afterward as "Protector of Peru," a title that says something about how unsettled the situation still was: independence had been declared, but not yet secured, and the man declaring it wasn't planning to stay as its ruler.
The Guayaquil meeting, and San Martín's exit
In 1822, San Martín traveled to Guayaquil to meet Bolívar, whose own campaigns were advancing from the north. What was actually said in that private meeting was never fully recorded by either man, and historians still debate what was agreed: what is known comes from each man's later, sometimes conflicting, accounts. What's certain is the outcome: San Martín withdrew from the independence struggle entirely afterward, leaving Bolívar to finish the campaign, and eventually left South America for exile in Europe, where he died in 1850 without returning.
Ayacucho, and what "independence" actually took
The war wasn't actually finished until the Battle of Ayacucho in December 1824, fought in the highlands under Sucre's command, which defeated the last major royalist army in South America and effectively ended Spanish rule on the continent. Three years passed between the proclamation in Lima's plaza and the battle that made it real — a gap worth sitting with, because it's the clearest evidence that a date on a flag and a country's actual freedom aren't always the same event. Peru's identity as a republic was born out of that gap: declared by an Argentine, secured by two Venezuelans, fought largely on Peruvian soil by armies that were only partly Peruvian, and only afterward built into the national story most Peruvians grow up with.
The final campaign has its own collection: Peru's wars of independence, 1824–1826, with essays on Junín, the Battle of Ayacucho and the Capitulation.
See where this fits on the Peru history timeline.