Mexico became an independent country on September 27, 1821, when the Army of the Three Guarantees entered Mexico City and the Spanish viceroy Agustín de Iturbide assumed authority. The following day, the provisional junta signed the Act of Independence of the Mexican Empire. Spain did not recognize that separation until 1836, and the federal republic was not constituted until 1824.

The short answer hides a harder question. "Becoming a country" is not one event but a stack of legal, military, and diplomatic thresholds. Mexico crossed them at different speeds, and historians still argue about which one counts.

The mechanism: three thresholds of statehood

Political scientists usually separate statehood into three tests. First, effective control: a new authority actually governs territory and collects obedience. Second, constitutional order: a defined set of institutions replaces personal rule. Third, recognition: other states and the former metropole accept the change.

Mexico's insurgency began on September 16, 1810, with Miguel Hidalgo's call to arms in Dolores. That date is celebrated as Independence Day, but in 1810 no one controlled the country. The rebellion lost battles, and Hidalgo was executed in 1811. For a decade, royalist armies held the cities while insurgents held roads and countryside.

The decisive mechanism was not battlefield victory but elite defection. In February 1821, Colonel Agustín de Iturbide, a royalist officer, published the Plan of Iguala. It promised three guarantees: independence, Catholic religion, and equality between peninsulares and criollos. By merging insurgent and royalist factions, Iturbide built an army that the Spanish crown could not defeat.

The last viceroy, Juan O'Donojú, signed the Treaty of Córdoba on August 24, 1821, acknowledging Mexican sovereignty. Spanish officials withdrew, and the army entered the capital on September 27. This is the legal founding moment most historians cite.

Plainly: Mexico did not win independence so much as negotiate it from a position of military stalemate.

Quantified context: a decade of war and its costs

The insurgency lasted eleven years, from 1810 to 1821. Estimates of deaths from combat, hunger, and epidemic disease during the war range from roughly 100,000 to several hundred thousand, though parish records are incomplete and scholars dispute the totals.

The Mexican War of Independence followed the Napoleonic crisis in Spain. French forces occupied Spain in 1808, and the Spanish constitution of 1812 briefly weakened royal authority in New Spain. Spain's inability to reinforce its colonies after 1814 created the opening that Iturbide exploited.

The geographic scale mattered too. New Spain in 1821 covered about 4.9 million square kilometers, including present-day Mexico, Central America, and vast northern territories. Mexico's first empire briefly stretched from the Pacific Northwest to Panama. That size made federal governance difficult and paved the way for the 1824 republic.

The founding timeline

Date Event What changed
September 16, 1810 Hidalgo's Grito de Dolores Insurgency begins
February 24, 1821 Plan of Iguala Royalist-insurgent coalition forms
August 24, 1821 Treaty of Córdoba Spanish viceroy recognizes independence
September 27, 1821 Army enters Mexico City Effective authority transfers
September 28, 1821 Act of Independence signed Legal founding document
May 19, 1822 Iturbide crowned emperor First government, a monarchy
March 19, 1823 Iturbide abdicates Empire collapses
October 4, 1824 Federal Constitution enacted Republic established
December 28, 1836 Spain recognizes independence Diplomatic threshold cleared

The list shows how stretched the answer is. Mexico's territory was independent in 1821, but its political identity as a republic arrived in 1824, and its international standing as a recognized state arrived in 1836.

Edge cases: where the simple answer breaks

The Treaty of Córdoba is legally ambiguous. The Spanish crown repudiated it in 1822, arguing that O'Donojú had no authority to renounce sovereignty. For fourteen years, Spain treated Mexico as a rebellious colony, and its refusal to recognize independence carried real consequences.

Spain's attempted reconquest in 1829 failed when a force landed at Tampico and was defeated. Only in 1836 did Spain sign the Santa María-Calatrava Treaty recognizing Mexican independence. So the diplomatic answer to "when did Mexico become a country" is 1836 for Spain, even though Mexico governed itself from 1821.

The empire itself collapsed within a year. Iturbide's fiscal policies alienated the army, and he dissolved Congress in 1822. A coalition of republicans forced his abdication in 1823. Mexico then wrote a constitution modeled partly on the United States and partly on Spanish liberal traditions.

Central America exited in 1823, forming its own federation. Texas separated in 1836 and joined the United States in 1845. These losses show that 1821's borders were provisional, not final.

Misconceptions worth correcting

The most common error is treating 1810 as the founding date. September 16 is Independence Day because that is when the movement began, not when a state existed. The distinction matters because it separates cultural memory from legal fact.

Another error assumes independence was immediate and complete. It was neither. Royalist armies remained in the field in 1821, and it took years to disarm and integrate them. Some Spanish troops left, and others switched sides.

A third error assumes the first government was a republic. It was a constitutional monarchy under a self-crowned emperor. The republic came in 1824, after the empire failed.

Counterintuitive detail: Mexico's independence movement was led in its final phase by a man who had spent years fighting rebels. Iturbide switched sides, and his defection mattered more than any single battle. Revolutions are often decided by who changes allegiance, not who wins the most engagements.

Practical actions for students and researchers

If you are writing about this topic, use the date that matches your question. That is the cleanest starting rule.

For legal founding, cite September 27 or 28, 1821 and the Act of Independence. For constitutional order, cite October 4, 1824 and the Federal Constitution. For diplomatic recognition, cite December 28, 1836 and the Santa María-Calatrava Treaty. Verify primary sources before quoting death tolls; parish data is patchy. Distinguish "independence" from "revolution" in your thesis statement.

For a school assignment, the safest framing is: political independence in 1821, republican institutions in 1824, and international recognition in 1836. That layered answer matches both textbooks and scholarship.

Limitations and open questions

Death estimates from the independence war remain contested because census and parish records were disrupted. Some scholars place the dead in the low hundreds of thousands, and others argue the figure is smaller. Treat any single number as an estimate.

The exact legal status of the 1821 transfer is debated. Some jurists regard the Treaty of Córdoba as void because the Spanish crown rejected it. Others treat it as binding despite that rejection. The dispute is historical, not practical, because no state currently claims authority over Mexico.

Dates are also calendar-fragile. September 27, 1821, is the date the army entered the capital, but the Act of Independence was signed the next day. Both are cited, and both are defensible. If someone asks you when Mexico became a country, the honest response is "1821, with caveats," and you should name the caveats.