How Peru Became a Country — Colonial Rule, Revolution, and the Long Struggle for Something Like Stability
Three centuries of Spanish colonial rule left Peru with a sophisticated legal apparatus, a capital that was the envy of South America, and a population that had never been permitted to govern itself. When independence arrived in 1821, it was won by Argentine and Colombian armies fighting on Peru's behalf. What came next was forty years of turbulence before anything resembling stable self-government appeared.
By BookOfWorldHistory·June 8, 2026·History·11 min read · 2,109 words
Originally published at: https://www.bookofworldhistory.com/blog/evolution-modern-peru-colonial-independence-republic-history
Three centuries of Spanish colonial rule left Peru with a sophisticated legal apparatus, a capital that was the envy of South America, and a population that had never been permitted to govern itself. When independence arrived in 1821, it was won by Argentine and Colombian armies fighting on Peru's behalf. What came next was forty years of turbulence before anything resembling stable self-government appeared.
Three centuries of Spanish colonial rule in Peru produced something complicated. The legal and administrative apparatus Spain installed was, by the standards of its time, sophisticated — a hierarchy of courts, a viceregal government, universities, the Catholic clergy managing education, and a body of law that the colonial administration at least nominally applied. The extraction that apparatus enabled was brutal. The social stratification it created was rigid and deliberate. And when independence finally arrived in 1821, it came through armies of Argentines and Colombians fighting on Peru's behalf, leaving behind a political culture with no practical experience of self-governance at any level.
What the colonial period built, in other words, was an elaborate structure designed to benefit Spain and a narrow class of Spanish-born colonists, and when Spain was removed from the equation the question of who governed and for whom had no prepared answer. The decades that followed independence were, predictably, turbulent.
The Council of Indies — Governing Peru From Madrid
The Casa de Contratación, established in 1503, handled commerce and trade between Spain and the American colonies — functioning roughly as the Spanish equivalent of the English India House. The Consejo de las Indias, the Council of the Indies, was instituted in 1511 and gradually absorbed most of the real governing authority over Spanish America. It enacted all laws and regulations for the colonies, made or confirmed all civil, military, and even ecclesiastical appointments, gave binding instructions to higher colonial officials, and served as the final court of appeal for significant cases arising in the New World. The King retained a nominal veto but exercised it rarely.
The Council paid almost no practical attention to conditions in the territories it governed from Madrid. Its laws were internally contradictory and arbitrarily enforced. Its attitude toward the native population was, by the standard of the institution's actual conduct, essentially that the Indians were beasts of burden bound to permanent vassalage — to Spanish settlers as much as to the Spanish crown. The system of repartimientos and encomiendas had been established before the conquest of Peru and arrived there as a matter of course once Pizarro, Almagro, and their partnership had divided the spoils of conquest between themselves.
The encomienda system itself had originated under Columbus's governance in the West Indies. Originally, Spanish colonists were assigned land with authority to require a particular Indian community to cultivate it. Later, encomiendas of Indians could be granted entirely separately from land grants. The kings of Spain, who were constantly pressed by suitors for royal favors and sometimes had little else to distribute, gave encomiendas. Some recipients farmed theirs out and became absentee proprietors of rights over human beings. The condition of the Indians shifted from serfdom toward outright slavery in everything but legal terminology.
Las Casas and the New Laws
In the depths of what the colonial system produced, one Spanish voice was raised consistently on behalf of the Indians. Bartolomé de las Casas was a Dominican friar who had lived in the Indies, had at one point himself held an estate worked by Indian serfs, and freed them when he concluded the arrangement was unjust. He wrote at length documenting the destruction of the Indian population, followed by a systematic argument against the encomienda system, and lobbied persistently and effectively at the Spanish court.
His influence produced the New Laws of 1542, which abolished the personal services of the Indians and prohibited the sale or inheritance of encomiendas. The colonial settlers resisted so fiercely that the viceroy sent to enforce the laws died in battle near Quito in 1546. In October 1545, a royal decree had already revoked the most threatening provisions. The colonists celebrated. The Indians did not.
Las Casas's legacy is genuinely complicated. He was concerned with Indian welfare in ways that few of his contemporaries were, and he was willing to put his career and reputation behind that concern. But he was also among those who, in seeking alternatives to Indian labor, suggested the importation of enslaved Africans — a contribution to a different catastrophe that he later, by some accounts, regretted. His campaign against Indian enslavement, whatever its mixed consequences, stands as the most serious attempt within the colonial system to confront what that system actually did.
Las Casas spent decades writing and lobbying on behalf of the Indian population of Spanish America. His influence produced the New Laws of 1542 — which the colonial settlers resisted so fiercely that the viceroy sent to enforce them died in battle and the most threatening provisions were quickly revoked.
Lima, the Viceroys, and the Colonial Social Order
Lima, founded by Pizarro in 1535, became the political, commercial, and social center of all Spanish South America. The viceroys held their courts there, selected from among the grandees of Spain, their salaries eventually fixed at forty thousand ducats to maintain the regal state expected of them. The jurisdiction of the Peruvian viceroy initially covered all Spanish possessions on the continent, with the captains-general of other provinces subject to his authority, until separate viceroyalties were carved out for New Granada in 1740 and Buenos Aires in 1776.
The Franciscan and Dominican orders arrived at an early stage. The Jesuits followed in 1567. The clergy controlled education entirely. Every village had its priest who required the Indians to attend mass and otherwise made the church's presence what one period account describes as an oppressive burden. The Inquisition was established in Peru in 1571, with the first auto-da-fé in Lima held two years afterward. The Indians were, notably, specifically exempt from its operations.
The social structure that developed under three centuries of viceregal rule had distinct, deliberate layers. At the top were pure-blood Spaniards born in Spain — the only group recognized as having full social standing, numbering around eight thousand at the close of the early conquerors' wars. Below them were the creoles, persons of European ancestry born in Peru, who were not considered to have the same rights or status as Spaniards despite often being indistinguishable in heritage. Below the creoles were the mestizos. Below all of these were the Indians. Spain's policy consistently and systematically protected the interests of the old Spaniards at the expense of everyone else — including the creoles who would eventually organize and lead the independence movement.
Lima was built by Pizarro, adorned by the viceroys across two centuries, nearly destroyed by earthquake in 1746 (killing more than a thousand people), and rebuilt into one of the most beautiful capitals in South America — the seat of a colonial system that simultaneously maintained sophisticated courts and systematic Indian enslavement.
San Martín and the Road to Independence
By the early 19th century, the signs of revolt were everywhere in Spanish America. Napoleon's invasion of Spain in 1808 and the resulting instability of the Spanish monarchy gave the colonies an opening that educated creoles across the continent began moving through. Peru was the last to go — held together by the Viceroy Abascal, who arrived in 1806 and managed with personal energy and administrative skill to keep the country for Spain while remitting money back to a home government too occupied with Napoleon to spare troops for its colonies. He recruited native armies to defend a Spanish cause those armies had no reason to care about, and he held on until his retirement in 1816.
The revolution arrived from outside. General José de San Martín had already accomplished Argentine and Chilean independence. He organized a small navy for the Pacific campaign and secured as its admiral Lord Cochrane — a Scottish adventurer of noble family and considerable daring — who cut out and captured the Spanish frigate Esmeralda from under the guns of the fortress at Callao on the night of November 5, 1820, in what was considered one of the most audacious naval captures on record.
Aided by Cochrane's fleet, San Martín landed 4,500 Argentine and Chilean troops on the Peruvian coast. The Spanish Viceroy La Serna had between twenty and twenty-five thousand troops — and an army full of independence sympathizers whose numbers made San Martín's force stronger every day. After fruitless negotiations in which San Martín proposed an independent constitutional monarchy under a Bourbon prince, La Serna evacuated Lima on July 6, 1821. San Martín entered a few days later. On July 28, 1821, Peru was proclaimed an independent republic, with San Martín as temporary dictator under the title of Protector.
Bolívar, Ayacucho, and the End of Spanish Rule
San Martín was Argentine, not Peruvian, and his authority as Protector sat uneasily with the people he was supposed to be liberating. When the royalists demonstrated in April 1822 that they had not disbanded, outside help was necessary. San Martín turned to Simón Bolívar, who had already liberated Venezuela and New Granada, formed the Republic of Colombia, and was capturing Ecuador from the Spaniards on his way south.
The two generals met at Quito. The conference ended with San Martín's retirement and Bolívar taking over the Peruvian campaign — a transition whose exact terms were never fully explained publicly by either man.
The decisive engagement was the Battle of Ayacucho in December 1824. Royalist casualties were 1,400 killed and 700 wounded. Patriot losses were 300 killed and 600 wounded. Under the terms of the capitulation arranged between the Viceroy La Serna and the patriot commander Sucre, the entire Spanish army — fourteen generals, 568 officers, and 3,200 soldiers — became prisoners of war. All remaining Spanish forces in Peru were bound by the surrender. Callao Castle held out for thirteen more months and then surrendered. The last Spanish flag on the South American mainland was hauled down.
The war for independence was over. Whether self-government would follow was a different question.
Ayacucho in December 1824 was the battle that ended Spanish rule on the South American mainland. The entire Spanish army — 14 generals, 568 officers, 3,200 soldiers — became prisoners of war under the terms of capitulation. Callao Castle held out 13 more months before the last Spanish flag came down.
The Republic — Twenty Years Before Anything Held
Three centuries of colonial exclusion from political life had their predictable effect. Bolívar went through the forms of offering to resign his dictatorship and summoning a congress, but the Peruvians had no real choice but to ask him to continue. He used the authority to carve Bolivia out of Upper Peru in 1825 — naming the new country after himself — and gave signs of intending to become the effective ruler of all South America before being called back to Colombia for domestic troubles. Peru then went through a series of competing military figures, a brief Peru-Bolivian Confederation under Santa Cruz in 1836 that produced temporary peace and then dissolved, and roughly twenty years during which, as one writer put it, it would have been difficult at any given moment to say with confidence who was the legitimate chief magistrate of the country.
The turn came with General Ramón Castilla, a quiet and modest soldier who had fought at Ayacucho and taken part in almost every revolution since. He returned from exile in 1844, entered the existing conflict on the side of whatever seemed most likely to produce stable government, and was elected president. He governed with a steadiness and practical wisdom that the country had not had since the ablest of the colonial viceroys. New wealth from guano and nitrate deposits on the desert islands off the coast provided the revenue to address Peru's long-standing financial problems. The constitution adopted in 1860 under his influence provided for elected executive and legislative branches, abolished slavery and the Indian tribute that had persisted from the colonial system, and declared forced military recruitment a crime. Castilla voluntarily retired from the presidency in 1862 — an act sufficiently unusual in Peruvian political history to be worth noting by itself.
The Nitrate War and the Long Road to Recovery
The stability Castilla built didn't survive his successors. The administrations that followed ran up enormous debts financing railways, harbors, urban embellishment, and the exploration of the Andes — all worthwhile things whose cost was, by 1876, consuming more than two-thirds of government revenues in interest on foreign debt alone. Pardo, the first civilian to reach the Peruvian presidency, handed over the government in 1876 apparently hopelessly bankrupt.
In 1879 came the War of the Pacific — fought with Chile over the valuable nitrate-producing coastal territories. In January 1881, Chilean forces occupied Lima and collected the country's customs revenues for two years while Peru descended into anarchy. Peace was arranged in October 1883 by Iglesias, a revolutionary leader who had the courage and the judgment to accept terms that were deeply unpopular but necessary. The Peruvian flag returned to the capital.
The financial wreckage was severe. The guano and nitrate revenues were gone — transferred to Chile under the peace terms. The government debt was crushing and foreign creditors were pressing for settlement. The solution was the Peruvian Corporation, a private company that took over Peru's railways, guano deposits, mines, and public lands in exchange for releasing the country from debts exceeding fifty million pounds sterling. Cáceres began reorganizing from 1886 with essentially nothing in the treasury.
Two constitutionally elected civilian presidents taking office in succession in the late 1890s and early 1900s were taken at the time as a genuinely hopeful sign — that the era of military coups and revolutionary government might be giving way to something more durable. Lima by then had been rebuilt after the earthquake of 1746, which had killed more than a thousand people and flattened the city, into one of the more beautiful of the South American capitals. The country that Pizarro had seized with fewer than two hundred men in 1533 had spent nearly four centuries becoming something else. Exactly what was still, at the turn of the 20th century, being worked out.