Agricultural societies and major civilisations developed over millennia in present-day Mexico, including the Olmecs, Zapotecs, Maya, inhabitants of Teotihuacan, Toltecs and Aztecs. Spanish conquest in the sixteenth century led to the creation of New Spain and the construction of Mexico City on the ruins of Tenochtitlan. Epidemics, forced labour and violence devastated Indigenous populations, but their communities and many languages and traditions survived.
Mexico and its historical heritage

In 1810 the priest Miguel Hidalgo called for an uprising against Spanish authority. José María Morelos continued the struggle. Many Indigenous and mixed-ancestry people participated, bringing social demands that did not always coincide with those of the Creole elites. The Plan of Iguala and the Treaty of Córdoba in 1821 paved the way for independence. Agustín de Iturbide became emperor in 1822 but abdicated in 1823. The Constitution of 1824 established a federal republic.
The United Mexican States in 1824

Texas seceded in 1836 and was annexed by the United States in 1845. The Mexican-American War (1846–1848) ended with the Treaty of Guadalupe Hidalgo and the cession of vast territories, including Upper California and New Mexico. The Reform War (1858–1861) between liberals and conservatives was followed by French intervention and the short-lived empire of Maximilian, overthrown in 1867.
The long rule of Porfirio Díaz (1876–1911, with an interruption) brought economic growth, foreign investment and railways, but also concentrated landownership, restricted political freedoms and deepened social inequality. The revolution of 1910 overthrew Díaz. Francisco Madero became president, but peasants, most prominently represented by Emiliano Zapata, continued to demand land. Madero was overthrown and murdered in 1913. Rival revolutionary factions then fought for power, with Zapata, Pancho Villa, Carranza and Obregón among the central figures.
Zapata with revolutionaries in Mexico City

The Constitution of 1917 enshrined important labour rights, enabled land redistribution and established national control over natural resources. Implementation was uneven and violence continued. Zapata was assassinated in 1919 and Villa in 1923. From 1929 one political party, under successive names, dominated the presidency until 2000. Despite social reforms, unequal distribution of wealth and the concentration of political power remained major problems.