The history of Mexico encompasses over 13,000 years between the initial migration of indigenous peoples and the modern day. Central and southern Mexico (termed Mesoamerica) saw the rise and fall of complex indigenous civilizations such as the Olmecs, Mayas and Aztecs. Mesoamerican civilizations developed glyph based writing systems, recording the political history of conquests and rulers. Mesoamerican history prior to European arrival is variously called the pre-hispanic era and the pre-Columbian era. In the 16th Century, the Spanish conquest of the Aztec Empire resulted in the creation of New Spain and the introduction of Christianity. Following Mexico's independence from Spain in 1821, the country faced numerous challenges including conflicts between 'strongmen' or caudillos the Mexican–American War, and the French invasion. In the early 19th century, Mexican Revolution resulted in the rise of the Institutional Revolutionary Party (PRI) which has served as the pre-eminent political party in the country until the modern day. Experiments with nationalization, reforms, and development projects resulted in the Mexican miracle during the 1940s to 1970s. Since then, Mexico has been defined by its incorporation into the North American Free Trade Agreement (NAFTA) in 1994, the Mexican peso crisis, and the Mexican drug war.

Pre-Columbian civilizations

Large and complex civilizations developed in the center and southern regions of Mexico (with the southern region extending into what is now Central America) in what has come to be known as Mesoamerica. The civilizations that rose and declined over millennia were characterized by:Ida Altman, Sarah Cline, and Javier Pescador, The Early History of Greater Mexico, Pearson 2003: pp. 9–14. significant urban settlements; monumental architecture such as temples, palaces, and the ball court; the division of society into religious and political elites (such as warriors and merchants) and commoners who pursued subsistence agriculture; the transfer of tribute and rendering of labor from commoners to elites; reliance on agriculture often supplemented by hunting and fishing and the complete absence of a pastoral (herding) economy since there were no domesticated herd animals before the arrival of the Europeans; trade networks and markets.

The history of Mexico before the Spanish conquest is known through the work of archaeologists, epigraphers, and ethnohistorians, who analyze Mesoamerican indigenous manuscripts, particularly Aztec codices, Mayan codices, and Mixtec codices. Accounts written by Spaniards at the time of the conquest (the conquistadores) and by Indigenous chroniclers of the postconquest period constitute the principal source of information regarding Mexico at the time of the Spanish Conquest. Few pictorial manuscripts (or codices) of the Maya, Mixtec, and Mexica cultures of the Post-Classic period survive, but progress has been made particularly in the area of Maya archaeology and epigraphy.

Beginnings

The presence of people in Mesoamerica was once thought to date back 40,000 years, an estimate based on what were believed to be ancient footprints discovered in the Valley of Mexico. This date may not be accurate after further investigation using radiocarbon dating. It is currently unclear whether 23,000-year-old campfire remains found in the Valley of Mexico are the earliest human remains uncovered so far in Mexico. The first people to settle in Mexico encountered a climate far milder than the current one. In particular, the Valley of Mexico contained several large paleo-lakes (known collectively as Lake Texcoco) surrounded by dense forest. Deer were found in this area, but most fauna were small land animals and fish and other lacustrine animals. Such conditions encouraged the pursuit of a hunter-gatherer existence. Indigenous peoples in western Mexico began to selectively breed maize (Zea mays) plants between 5,000 and 10,000 years ago. The diet of ancient central and southern Mexico was varied, including domesticated corn (or maize), squashes, beans, tomatoes, peppers, cassavas, pineapples, chocolate, and tobacco. The Three Sisters (corn, squash, and beans) constituted the principal diet.

In Mesoamerican belief systems, every element of the cosmos and every part of nature represented a supernatural manifestation. The spiritual pantheon was vast and extremely complex. They frequently took on different characteristics and names in different areas, but in effect, they transcended cultures and time. Great masks with gaping jaws and monstrous features in stone or stucco were often located at temple entrances, symbolizing a cavern or cave on the flanks of the mountains that allowed access to the depths of Mother Earth and the shadowy roads that lead to the underworld. Cults connected with the jaguar and jade permeated religion throughout Mesoamerica. Jade and water were revered as symbols of life and fertility. The jaguar, agile, powerful, and fast, was tied to warriors and as spirit guides of shamans. Despite differences in chronology or geography, the essential elements of this religious pantheon were shared amongst the people of ancient Mesoamerica. Thus, this quality of acceptance of new gods to the collection of existing gods may have been one of the shaping characteristics for success during the Christianization of Mesoamerica. New gods did not at once replace the old; they initially joined the ever-growing family of deities or were merged with existing ones that seemed to share similar characteristics or responsibilities.

Mesoamerica is the only place in the Americas where Indigenous writing systems were invented and used before European colonization. While the types of writing systems in Mesoamerica range from minimalist "picture-writing" to complex logophonetic systems capable of recording speech and literature, they all share some core features that make them visually and functionally distinct from other writing systems of the world. Although many indigenous manuscripts have been lost or destroyed, texts known as Aztec codices, Mayan codices, and Mixtec codices have survived and are of intense interest to scholars.

Major civilizations

During the pre-Columbian period, many city-states, kingdoms, and empires competed for power and prestige. Ancient Mexico can be said to have produced five major civilizations: the Olmec, Maya, Teotihuacan, Toltec, and Aztec. Unlike other indigenous Mexican societies, these civilizations (except the politically fragmented Maya) extended their political and cultural reach across Mexico and beyond.

They consolidated power and exercised influence in trade, art, politics, technology, and religion. Over 3,000 years, other regional powers made economic and political alliances with them; many made war on them. But almost all found themselves within their spheres of influence.

Olmecs (1500–400 BCE)

The Olmec first appeared along the Atlantic coast (modern-day Tabasco) in 1500–900 BCE. The Olmecs were the first Mesoamerican culture to produce an identifiable artistic and cultural style and may also have been the inventors of writing in Mesoamerica. By the Middle Preclassic Period (900–300 BCE), Olmec artistic styles had been adopted as far away as the Valley of Mexico and Costa Rica.

Maya

Maya cultural characteristics, such as the rise of the ahau, or king, can be traced from 300 BCE onward. During the centuries preceding the classical period, Maya kingdoms stretched from the Pacific coasts of southern Mexico and Guatemala to the northern Yucatán Peninsula. The egalitarian Maya society of pre-royal centuries gradually led to a society controlled by a wealthy elite that began building large ceremonial temples and complexes. The earliest known long-count date, 199 AD, heralds the classic period, during which the Maya kingdoms supported a population numbering in the millions. Tikal, the largest of the kingdoms, alone had 500,000 inhabitants, though the average population of a kingdom was much smaller—somewhere under 50,000 people.

Teotihuacan

Teotihuacan is an enormous archaeological site in the Basin of Mexico, containing some of the largest pyramidal structures built in the pre-Columbian Americas. Apart from the pyramidal structures, Teotihuacan is also known for its large residential complexes, the Avenue of the Dead, and numerous colorful, well-preserved murals. Additionally, Teotihuacan produced a thin orange pottery style that spread through Mesoamerica.Ancient Mexico and Central America

The city is thought to have been established around 100 BCE and continued to be built until about 250 CE. The city may have lasted until sometime between the 7th and 8th centuries CE. At its zenith, perhaps in the first half of the 1st millennium CE, Teotihuacan was the largest city in the pre-Columbian Americas. At this time, it may have had more than 200,000 inhabitants, placing it among the world's largest cities in this period. Teotihuacan was even home to multi-floor apartment compounds built to accommodate this large population.

The civilization and cultural complex associated with the site is also referred to as Teotihuacan or Teotihuacano. Although it is debated whether Teotihuacan was the center of a state empire, its influence throughout Mesoamerica is well documented. The ethnicity of the inhabitants of Teotihuacan is also a subject of debate. Possible candidates are the Nahua, Otomi or Totonac ethnic groups. Scholars have also suggested that Teotihuacan was a multiethnic state.

Toltec

The Toltec culture is an archaeological Mesoamerican culture that dominated a state centered in Tula, Hidalgo, in the early post-classic period of Mesoamerican chronology (ca 800–1000 AD). The later Aztec culture saw the Toltecs as their intellectual and cultural predecessors and described Toltec culture emanating from Tollan (Nahuatl for Tula) as the epitome of civilization; indeed, in the Nahuatl language, the word "Toltec" came to take on the meaning "artisan."

The Aztec oral and pictographic tradition also described the history of the Toltec empire, giving lists of rulers and their exploits. Among modern scholars, it is a matter of debate whether the Aztec narratives of Toltec history should be given credence as descriptions of actual historical events. Other controversies relating to the Toltecs include how best to understand the reasons behind the perceived similarities in architecture and iconography between the archaeological site of Tula and the Maya site of Chichén Itzá – no consensus has emerged yet about the degree or direction of influence between the two sites.

Aztec Empire (1325–1521 CE)

The Nahua people began to enter central Mexico in the 6th century CE. By the 12th century, they had established their center at Azcapotzalco, the city of the Tepanecs.

The Mexica people arrived in the Valley of Mexico in 1248 CE. They had migrated from the deserts north of the Rio Grande over a period traditionally said to have been 100 years. They may have thought of themselves as the heirs to the prestigious civilizations that had preceded them. What the Aztecs initially lacked in political power, they made up for with ambition and military skill. In 1325, they established the biggest city in the world, Tenochtitlan.

Aztec religion was based on the belief in the continual need for regular offerings of human blood to keep their deities beneficent; to meet this need, the Aztecs sacrificed thousands of people. This belief is thought to have been common throughout the Nahuatl people. To acquire captives in times of peace, the Aztecs resorted to ritual warfare called flower war. The Tlaxcalteca, among other Nahuatl nations, were forced into such wars. Though human sacrifice was common in Mesoamerica, the scale of human sacrifice under the Aztecs was likely unprecedented in the region.