Mexico, formally known as the United Mexican States, is a nation in southern North America. The United States borders it on the north; the Pacific Ocean on the south and west; Guatemala, Belize, and the Caribbean Sea on the southeast; and the Gulf of Mexico on the east. Mexico is the world's 13th-largest nation by area, with 1,972,550 square kilometers (761,610 square miles); with around 126,014,024 residents, it is the 10th-most populated country and has the most Spanish-speakers. Mexico is structured as a federation of 31 states and its capital, Mexico City. With a population of almost 21 million people, the capital is not just a primate city, but also one of the world's biggest. Guadalajara, Monterrey, Puebla, Toluca, Tijuana, Ciudad Juárez, and León are other large cities.
Pre-Columbian Mexico dates back to 8,000 BCE and is considered one of the world's six civilization cradles. The Mesoamerican area, in particular, was home to several interrelated civilizations, including the Olmec, Maya, Zapotec, Teotihuacan, and Purepecha. Last but not least were the Aztecs, who ruled the area in the century before European contact. The Spanish Empire and its indigenous allies defeated the Aztec Empire from Tenochtitlan, now Mexico City, in 1521, creating the province of New Spain. From the colonial period forward, the image of Mexico's prehispanic indigenous civilizations has played a critical part in the construction of a unique Mexican identity, as embodied by the post-independence national flag with Aztec eagle. The Spanish state and the Catholic Church, both controlled by the Spanish crown, had crucial, interconnected institutional roles in extending colonial territory, imposing Christianity, and promoting the Spanish language over the three centuries after the conquest. Spanish power brought Mesoamerican indigenous peoples into colonial order, initially preserving indigenous social and economic institutions. Indigenous elites were acknowledged as nobles during Spanish control, and they functioned as liaisons between their communities and the Spanish governing apparatus. Northern Mexico was located outside of Mesoamerica; it was sparsely inhabited, and the indigenous peoples resisted invasion. Under Spanish dominion, the vast and diversified indigenous populations, known as "Indians" (indios), were at the bottom of the formal racial hierarchy, with the tiny number of white, European Spaniards (espaoles) at the top and the small community of mixed-race castas in the center. The discovery of vast silver resources beyond the zone of established indigenous people in Zacatecas and Guanajuato in the 1540s saw the Spanish Empire expand northward, with population increase as riches was extracted. Wealth from Asia and the New International streamed into Europe via the ports of Acapulco and Veracruz, contributing to Spain's role as a key world power for the following decades and causing a pricing revolution in Western Europe. The colonial order came to an end in the early nineteenth century with the War of Independence against Spain, which began in 1810 as a result of Napoleon's invasion of Spain and was successfully concluded in 1821 by an alliance of mixed-race insurgents led by Vicente Guerrero and previously royalist creole elites led by Agustn de Iturbide.
Political and economical instability characterized Mexico's early existence as an independent nation state. Liberal and conservative forces often altered the structure of administration, which alternated between brief monarchs and republics. During the nineteenth century, the nation was invaded by two foreign powers: first, following the Texas Revolution by American immigrants, which resulted in the Mexican–American War and massive territory losses to the United States after defeat in 1848. The Constitution of 1857 incorporated liberal reforms aimed at integrating indigenous people and limiting the role of the military and the Catholic Church. Conservatives responded with the Reform War, inviting France to invade and crown Maximilian Habsburg as Emperor against the Republican opposition headed by liberal President Benito Juárez. With the conclusion of the American Civil War and France's evacuation of its troops for the war with Prussia, the republicans supported by the United States reclaimed the nation and deposed the monarch. The dictatorship of military hero Porfirio Daz, who tried to modernize Mexico and restore order, dominated the later decades of the nineteenth century. The Porfiriato period (1876-1910) caused widespread social upheaval and culminated in the commencement of Mexico's decade-long civil war (Mexican Revolution). This struggle resulted in significant changes in Mexican culture, notably the adoption of the 1917 Constitution, which is still in force today.
The surviving Revolutionary generals reigned as a series of presidents until the murder of Alvaro Obregón in 1928, when the Institutional Revolutionary Party (PRI) was formed the following year. The PRI ruled Mexico for 70 years, beginning with a series of paternalistic developmental policies that yielded significant economic success, such as President Lázaro Cárdenas' socially-oriented nationalization attempts. Mexico also played an essential part in the United States' war effort during WWII, contributing to economic expansion. However, the PRI administration degraded over decades into a series of violent repressions (such as the Tlatelolco Massacre at the start of the 1968 Olympics), electoral frauds (such as the 1988 election), and a shift to a more US-aligned neoliberal economic strategy in the late twentieth century. The passage of the North American Free Trade Agreement in 1994 precipitated a significant indigenous insurrection in the state of Chiapas. In 2000, the PRI lost the presidency for the first time to the conservative party (PAN).
Mexico is a poor nation, ranked 74th on the Human Development Index, yet it possesses the world's 15th-biggest nominal GDP and 11th-largest PPP economy, with the United States as its major economic partner. Mexico is a regional and intermediate power due to its vast economy and population, worldwide cultural impact, and gradual democratization; it is often characterized as a rising power but is regarded a recently industrialized state by numerous scholars. However, the nation continues to face socioeconomic inequality, poverty, and widespread criminality. It scores low on the Global Peace Index, owing to persistent warfare between the government and drug trafficking syndicates, who struggle fiercely for the US drug market and trade routes. Since 2006, this "drug war" has resulted in almost 120,000 fatalities.
Mexico has the most UNESCO World Heritage Sites in the Americas and the seventh most in the world. It is also one of 17 megadiverse nations on the planet, ranking sixth in natural biodiversity. Mexico's diverse cultural and ecological history, as well as its varied temperature and topography, make it a popular tourist destination: in 2018, it was the world's sixth most-visited country, with 39 million foreign tourists. Mexico is a member of the United Nations, the Group of 20 (G-20), the Organization for Economic Cooperation and Development (OECD), the World Trade Organization (WTO), the Asia-Pacific Economic Cooperation forum, the Organization of American States, the Community of Latin American and Caribbean States, and the Organization of Ibero-American States.