Following the Mexican declaration of war in 1810, protracted fighting erupts cross the country until independence is won in 1821. War leaves Mexico in a state of disorder and deterioration; slowly the Mexicans begin building their social and political infrastructure to make way for republican government. This process is interrupted by a U.S. invasion of Mexico in 1846; by the terms of the Treaty of Guadalupe Hidalgo (1848), Mexico cedes a large portion of its northern territory to the U.S. In the mid-1850s, important steps are taken in the democratic evolution of the country, including a new constitution that separates church and state (in effect until 1917). Under the leadership of the first Indian president of the Americas, Benito Juárez (1806–1872), Mexico drives the French out and founds a democratic republic that survives until Juárez’s death in 1872. In 1876, Porfirio Díaz (1830–1915) leads a military takeover of Mexico City and assumes the presidency (1876–80; 1884–1911). To the detriment of indigenous Mexicans, he promotes railroad construction, increased trade, and modernization by concessions to foreign investors. Reaction against this Porfiriato, as his rule is called, precipitates the Revolution of 1910.
While under Spanish rule, Central America is a colonial backwater and lags economically and culturally behind other centers. It is spared the bloody wars that characterize the independence movements of Mexico and Spanish South America. In 1823, the United Provinces of Central America is formed, consisting of Guatemala, El Salvador, Honduras, Nicaragua, and Costa Rica (Panama is part of Colombia until 1903, Belize a colony of British Honduras until 1973). Destructive civil wars and political unrest ensue, so that by 1841 the five countries split apart. Instead of realizing the dream of a united and prosperous independent isthmian nation, Central America remains a feuding cluster of city-states calling themselves “republics.” Despite the failure of a union, their individual flags—all bearing a white stripe between two blue stripes (land between the two oceans)—symbolize shared histories and future hopes. Plans to construct an inter-oceanic canal through Central America spells continual international interference in the affairs of the region, particularly from Britain and the U.S. These plans culminate in the Panama Canal in 1914.