Mexico (Spanish: México), officially the United Mexican States, is a country in the southern portion of North America. It is bordered to the north by the United States; to the south and west by the Pacific Ocean; to the southeast by Guatemala, Belize, and the Caribbean Sea; and to the east by the Gulf of Mexico. Mexico covers 1,972,550 square kilometers (761,610 sq mi), making it the world's 13th-largest country by area; with approximately 126,014,024 inhabitants, it is the 10th-most-populous country and has the most Spanish-speakers. Mexico is organized as a federal republic comprising 31 states and Mexico City, its capital. Other major urban areas include Monterrey, Guadalajara, Puebla, Toluca, Tijuana, Ciudad Juárez, and León.Human presence in Pre-Columbian Mexico goes back to 8,000 BCE and it went to become one of the world's six cradles of civilization. In particular, the Mesoamerican region was home to many intertwined civilizations; including the Olmec, Maya, Zapotec, Teotihuacan, and Purepecha. Last were the Aztecs, who dominated the region in the century before European contact. In 1521, the Spanish Empire and its indigenous allies conquered the Aztec Empire from its capital Tenochtitlan (now Mexico City), establishing the colony of New Spain. Over the next three centuries, Spain and the Catholic Church played an important role expanding the territory, enforcing Christianity and spreading the Spanish language throughout. With the discovery of rich deposits of silver in Zacatecas and Guanajuato, New Spain soon became one of the most important mining centers worldwide. Wealth coming from Asia and the New World contributed to Spain's status as a major world power for the next centuries, and brought about a price revolution in Western Europe. The colonial order came to an end in the early nineteenth century with the War of Independence against Spain.
Mexico's early history as an independent nation state was marked by political and socioeconomic upheaval, both domestically and in foreign affairs. The Federal Republic of Central America shortly seceded the country. Then two invasions by foreign powers took place: first, by the United States as a consequence of the Texas Revolt by American settlers, which led to the Mexican–American War and huge territorial losses in 1848. After the introduction of liberal reforms in the Constitution of 1857, conservatives reacted with the war of Reform and prompted France to invade the country and install an Empire, against the Republican resistance led by liberal President Benito Juárez, which emerged victorious. The last decades of the 19th century were dominated by the dictatorship of Porfirio Díaz, who sought to modernize Mexico and restore order. However, the Porfiriato era led to great social unrest and ended with the outbreak in 1910 of the decade-long Mexican Revolution (civil war). This conflict had profound changes in Mexican society, including the proclamation of the 1917 Constitution, which remains in effect to this day. The remaining war generals ruled as a succession of presidents until the Institutional Revolutionary Party (PRI) emerged in 1929. The PRI in turn governed Mexico for the next 70 years, first under a set of paternalistic developmental policies of considerable economic success. During World War II Mexico also played an important role for the Allied war effort. Nonetheless, the PRI regime resorted to repression and electoral fraud to maintain power; and moved the country to a more US-aligned neoliberal economic policy during the late 20th century. This culminated with the signing of the North American Free Trade Agreement in 1994, which caused a major indigenous rebellion in the state of Chiapas. PRI lost the presidency for the first time in 2000, against the conservative party (PAN).
Mexico has the world's 15th-largest economy by nominal GDP and the 11th-largest by PPP, with the United States being its largest economic partner. As a newly industrialized and developing country ranking 86th, high in the Human Development Index, its large economy and population, cultural influence, and steady democratization make Mexico a regional and middle power which is also identified as an emerging power by several analysts. Mexico ranks first in the Americas and seventh in the world for the number of UNESCO World Heritage Sites. It is also one of the world's 17 megadiverse countries, ranking fifth in natural biodiversity. Mexico's rich cultural and biological heritage, as well as varied climate and geography, makes it a major tourist destination: as of 2018, it was the sixth most-visited country in the world, with 39 million international arrivals. However, the country continues to struggle with social inequality, poverty and extensive crime. It ranks poorly on the Global Peace Index, due in large part to ongoing conflict between drug trafficking syndicates, which violently compete for the US drug market and trade routes. This "drug war" has led to over 120,000 deaths since 2006. Mexico is a member of United Nations, the G20, the Organisation for Economic Co-operation and Development (OECD), the World Trade Organization (WTO), the Asia-Pacific Economic Cooperation forum, the Organization of American States, Community of Latin American and Caribbean States, and the Organization of Ibero-American States.