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 km2 (761,610 sq mi), making it the world's 13th-largest country by area; with a population of over 126 million, 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.
Human presence in Pre-Columbian Mexico goes back to 8,000 BCE. It became one of the world's six cradles of civilization. The Mesoamerican region was home to many intertwined civilizations, including the Olmec, Maya, Zapotec, Teotihuacan, and Purepecha. The Aztecs 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 expanded the territory, enforced Christianity and spread the Spanish language. With the discovery of rich deposits of silver in Zacatecas and Guanajuato, New Spain became one of the most important mining centers worldwide. The colonial order came to an end in the early nineteenth century with the Mexican War of Independence.
Mexico's early history as an independent nation state was marked by political and socioeconomic upheaval, both domestically and in foreign affairs. The United States invaded 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.