Modern Mexico emerged from the colony of Viceroyalty of New Spain. The Mexican War of Independence, begun by the priest Miguel Hidalgo in 1810, ended in independence in 1821. The young republic was unstable, dominated by Caudillos, and lost about half its territory to the United States by 1848. Under the long dictatorship of Porfirio Díaz (1876–1911) foreign investors built railroads, mines and oil wells, while villages lost their land to great estates; Mexico became a classic case of Economic Imperialism.
The Mexican Revolution of 1910–1920 overthrew that order. Peasant armies led by Emiliano Zapata and Pancho Villa fought alongside and against middle-class constitutionalists, and the Mexican Constitution of 1917 promised land reform, labor rights and national ownership of subsoil resources. Stability came with the party later called the Institutional Revolutionary Party (PRI) (PRI), which governed without interruption from 1929 to 2000. President Lázaro Cárdenas (1934–1940) fulfilled much of the revolution's program, distributing some 18 million hectares to peasant communities and, in 1938, nationalizing the foreign-owned Petroleum industry, a leading example of the more active economic role governments assumed after the Great Depression.
From the 1940s to the 1970s Mexico pursued Import Substitution Industrialization behind high tariffs. Growth averaged about six percent a year, a period called the Mexican Miracle, and Mexican research stations were the birthplace of the Green Revolution. But the system was authoritarian, as the army's killing of student protesters at Tlatelolco in Mexico City in 1968 showed, and it depended on borrowing. When oil prices fell and interest rates rose, Mexico announced in 1982 that it could not service its foreign debt, triggering the Latin American debt crisis.
The response reversed half a century of policy. Guided by the International Monetary Fund, Mexican governments cut spending, privatized hundreds of state firms, joined the General Agreement on Tariffs and Trade (GATT) in 1986 and negotiated the North American Free Trade Agreement with the United States and Canada, in force from 1 January 1994. Manufacturing for export surged: Maquiladoras along the border and auto plants built by firms such as Nissan and Toyota made Mexico one of the world's leading exporters of cars, electronics and appliances, which is why the CED cites it for the shift of industrial production to Latin America.
The costs were also plain. Cheap imported maize undercut small farmers; the Zapatista Uprising in Chiapas began the day NAFTA took effect; a currency collapse followed in December 1994; wages stagnated and millions migrated north. Political change came too: in 2000 the PRI lost the presidency for the first time, and in 2024 Claudia Sheinbaum became Mexico's first woman president. NAFTA itself was replaced in 2020 by a renegotiated United States–Mexico–Canada Agreement (USMCA), which kept Mexico's manufacturing tied to the north. Mexico's trajectory, from revolution and nationalization to liberalization, traces in one country the larger arc of the twentieth-century world economy.