History

The Messiest Half-Century in Mexico City's History

Two different men tried to rule Mexico in the fifty-odd years after independence, and both of them ended up in front of a firing squad before eventual stability.

Andrew D. Daily·Updated August 2026
Quick answer

The half-century after Mexican independence in 1821 was the most unstable period in Mexico City's history. Agustín de Iturbide, who won independence and then crowned himself emperor, was executed in 1824 after his empire collapsed within ten months. What followed was a revolving door of governments, with Antonio López de Santa Anna alone holding the presidency eleven separate times, and a war with the United States that cost the country half its territory. A second emperor, the French-backed Maximilian I, was captured and executed in 1867 despite pleas for clemency, on the order of Benito Juárez, the elected president who had refused to recognize his rule and kept governing from exile throughout the French occupation. The Republic was restored that same year, and this time it held.

On September 28, 1821, Agustín de Iturbide rode into Mexico City at the head of an army, church bells ringing across the capital, at the end of eleven years of war that had started with a parish priest’s cry for revolt in a small town called Dolores. Independence was won. Three years later, Iturbide would be dead, shot by firing squad in the country he’d just freed.

Eleven years to win it, ten months to lose it

Independence hadn’t come quickly. Miguel Hidalgo’s call to arms in 1810, the Grito de Dolores, set off a decade of insurgency that cost hundreds of thousands of lives before it produced any kind of resolution. That resolution came, in the end, from a former royalist officer switching sides: Iturbide struck a deal with the insurgent leader Vicente Guerrero, the Plan de Iguala, guaranteeing independence, and the Spanish crown formally recognized it that August.

Iturbide didn’t stay a liberator for long. In May 1822, he had himself crowned Emperor Agustín I. The empire lasted ten months before regional revolts, one of them led by a young officer named Antonio López de Santa Anna, forced his abdication. Iturbide went into European exile; when he tried to return to Mexico in 1824, unaware that Congress had already declared him a traitor subject to execution on sight, he was captured almost immediately. He was shot in the town of Padilla on July 19, 1824.

A revolving door

The man who’d helped topple Iturbide became the era’s defining figure. Antonio López de Santa Anna held the presidency eleven separate times between 1833 and 1855, terms that together added up to barely six years of actual governing. He treated the office as something to pick up and set down as it suited him, retreating to his hacienda outside Veracruz whenever the job got difficult and returning whenever the country seemed to need saving again. In 1838 he lost a leg to French grapeshot during a skirmish known as the Pastry War, had it buried with full military honors, then exhumed it four years later for a grand funeral procession through the capital. Two years after that, an angry mob dug it back up and dragged it through the streets. Few details capture the era better than that leg’s two burials.

Continued invasions

That instability was still the backdrop when war broke out with the United States in 1846. Mexico lost, decisively, two years later at the gates of Chapultepec Castle, where a group of teenage military cadets held a position their own army had already abandoned. Six died in the fighting — Juan de la Barrera, Juan Escutia, Francisco Márquez, Agustín Melgar, Fernando Montes de Oca, and Vicente Suárez — remembered today as the Niños Héroes. The most famous version of the story, that Escutia wrapped himself in the flag and leapt from the castle walls rather than let it fall into enemy hands, doesn’t hold up well historically: no cadet by that name appears in the academy’s own enrollment records, and the story itself only surfaced decades later, during the Porfiriato. What’s certain is simpler, and still remarkable: teenagers held ground their own commanders had already given up on, and six of them didn’t walk away. The Treaty of Guadalupe Hidalgo, signed that February, handed the United States roughly half of Mexico’s territory.

Even that wasn’t the end of it. Mexico’s treasury was empty by 1861, drained by decades of war, and President Juárez suspended payments on debts owed to France, Spain, and Britain rather than keep borrowing to cover them. The three powers responded that December with a joint fleet at Veracruz, ostensibly there only to collect. Spain and Britain negotiated a settlement and withdrew within months, once it became clear that France’s Napoleon III wanted more than money: a Mexican monarchy under French influence, and a foothold on a continent that had mostly finished throwing European empires out. The French army pushed inland alone and lost badly at Puebla on May 5, 1862, a defeat still celebrated every year as Cinco de Mayo, before returning with reinforcements to take Mexico City the following year. In 1864, with backing from Mexican conservatives, France installed the Austrian archduke Maximilian as emperor.

The president who wouldn’t leave

Mexico already had a president when Maximilian arrived. Benito Juárez, a Zapotec lawyer from a mountain village in Oaxaca who hadn’t spoken a word of Spanish until he was twelve, had been elected in 1858 and never stopped governing, even as the French pushed his administration out of the capital and then out of one city after another. By 1863 he was running the legitimate government from Chihuahua, in the country’s arid north, refusing at every point to recognize Maximilian’s rule.

Maximilian lasted three years before French troops withdrew and left him without an army. Juárez’s forces captured him outside Querétaro; European monarchs and admirers abroad, including the writer Victor Hugo, pleaded for his life. Juárez refused every appeal. Maximilian was executed by firing squad on June 19, 1867.

That death closed a loop opened forty-three years earlier at Padilla: two emperors, one homegrown and one imported, both shot by firing squad within a single half-century. The man who’d refused to recognize either one outlasted them both, governing for five more years until his death in office in 1872. The revolving door finally stopped.

Sources: Mexico News Daily’s account of Iturbide’s rise and fall and its reporting on the historical debate over the Niños Héroes; the text of the Treaty of Guadalupe Hidalgo; historical accounts of Santa Anna’s amputated leg and its two burials; the 1861 Convention of London and the French intervention that followed it; and of Benito Juárez’s presidency and Maximilian I’s capture and execution at Querétaro.

Explore another section

Where to StayTrip PlanningItineraries & To-DosDay TripsFood CulturePractical

Enjoyed this guide?

Weekly emails — what's happening in CDMX, plus a deep-dive guide like this one.