Mexico's path to nationhood was neither swift nor simple. While indigenous civilizations like the Maya and Aztec flourished for millennia, the modern Mexican state traces its legal founding to September 27, 1821 — the day the Army of the Three Guarantees entered Mexico City, effectively ending Spanish colonial rule.
The Mexican War of Independence began on September 16, 1810, with Miguel Hidalgo's famous Grito de Dolores. After 11 years of conflict, the Treaty of Córdoba recognized Mexican sovereignty. Initially, the new nation declared itself the Mexican Empire under Agustín de Iturbide.
Iturbide's reign was short-lived. By 1823, republican forces had overthrown the empire, and on October 4, 1824, the Federal Constitution of the United Mexican States was enacted, establishing Mexico as a federal republic — the political structure that endures today.
So while 1821 marks the de facto* birth of an independent Mexico, 1824 cemented its *de jure* identity as the republic we know today.