Mexico declared itself independent of Spain in 1821 following ten years of sporadic warfare. Independence brought a century of domestic violence over regional, ideological, religious, and personal differences. Mexico’s fractured governments faced war with rebellious states and with foreign powers, including the United States, France, and Spain.
In 1833, in the absence of President Antonio López de Santa Anna (1794–1876), the liberal Vice-President Valentin Gómez Farias (1781–1858) obtained legislation that restricted the Catholic Church’s power and eliminated some military privileges, measures that caused an uprising of the country’s conservatives. After the revolt was put down, the government authorized a medal for the militia defenders at Puebla.
Alarmed by the large number of American settlers in the Mexican state of Texas, the Mexican government closed the border to immigration in 1830 and imposed numerous restrictions, including the abolition of slavery. Armed conflict between settlers and the Mexican army began in late 1835, and the Republic of Texas declared its independence in March 1836. After the Texans’ defeat of General Santa Anna in April 1836, Mexico made no further attempt to reconquer the territory but refused to recognize its independence. Annexation of Texas by the United States in 1845 and a dispute over the territory’s southern border led to war in 1846. General Zachary Taylor (1784–1850) invaded Mexico from the north, and General Winfield Scott (1786–1866) landed at Veracruz in the south and marched inland to capture Mexico City in September 1847 and end the fighting. By the terms of the Treaty of Guadalupe Hildago, signed in February 1848, Mexico ceded almost half its national territory to the United States.
Faced with enormous financial burdens, the government of Benito Juárez suspended payment on foreign debt in 1861. England, Spain, and France landed troops at Veracruz early in 1862, but England and Spain soon withdrew. French troops eventually occupied Mexico City in 1863, forcing the Mexican government to relocate north to continue the war. Napoleon III placed Maximilian, archduke of Austria, on the Mexican throne, and he ruled the country for three years with the aid of Mexican conservatives and the church. Facing criticism at home and pressure abroad, Napoleon withdrew his troops in 1867, enabling republican forces to retake Mexico City and to capture Maximilian. President Juárez refused clemency, and Maximilian’s empire collapsed with his execution.