Human presence in Mesoamerica has been shown to date back 40,000 years based upon ancient human footprints discovered in the Valley of Mexico (previous evidence substantiated indigenous inhabitants at 12,500 years ago). For thousands of years, Mesoamerica was a land of hunter-gatherers. Around 9,000 years ago, ancient indigenous people’s domesticated corn and initiated an agricultural revolution, leading to the formation of many complex civilizations.
These civilizations revolved around cities with writing, monumental architecture, astronomical studies, mathematics, and militaries. For almost three thousand years, Aridoamerica and Mesoamerica were the site of several advanced Amerindian civilizations.
In 1519, the native civilizations of Mesoamerica were invaded by Spain; among them the Aztecs, Mayans, Olmecs, etc. This was one of the most important conquest campaigns in America. Two years later, in 1521, the Aztec capital of Tenochtitlan was conquered by the Spaniards along with the Tlaxcaltecs, the main enemies of the Aztecs, marking end to the Aztec Empire and giving rise to the Viceroyalty of New Spain in 1535, it became the first and largest provider of resources for the Spanish Empire, and the most populated of all Spanish colonies.
Colonial era and independence
Almost 300 years after the New Spain was created, on September 16, 1810, independence from Spain was declared by Priest Miguel Hidalgo y Costilla, in the small town of Dolores, Guanajuato. This was the catalyst for a long war that ended in 1821 which eventually led to the independence and creation of the ephemeral First Mexican Empire. Agustín de Iturbide was the first and only emperor. Two years later, he was deposed by the republican forces. In 1824, a republican constitution was drafted creating the United Mexican States with Guadalupe Victoria as its first President.
The first four decades after the creation of the country were marked by a constant strife between liberales (those who supported the federal form of government stipulated in the 1824 constitution) and conservadores (who proposed a hierarchical form of government in which all local authorities were appointed and subject to a central authority). General Antonio López de Santa Anna was a strong influence in Mexican politics, a centralist and a two-time dictator. In 1836, he approved the Siete Leyes, a radical amendment to the constitution that institutionalized the centralized form of government. Having suspended the Constitution of 1824, civil war spread across the country, and three new governments declared independence; the Republic of Texas, the Republic of the Rio Grande (recognized by the United Kingdom) and the Republic of Yucatán. Only Texas was able to defeat Santa Anna, and later the annexation of Texas by the United States created a border dispute that would cause the Mexican-American War. Santa Anna played a big role in trying to muster Mexican forces but this war resulted in the resolute defeat of Mexico and as a result of the Treaty of Guadalupe Hidalgo (1848), Mexico lost one-third of its surface area due to civil war with Texas, and later war with the United States.
Dissatisfaction with Santa Anna’s return to power, and his unconstitutional rule, led to the liberal Revolution of Ayutla, which initiated an era of liberal reforms, known as La Reforma, after which a new constitution was drafted that reestablished federalism as the form of government and first introduced freedom of religion. In the 1860’s the country again underwent a military occupation, this time by France, which established the Habsburg Archduke Ferdinand Maximilian of Austria on the Mexican throne as Emperor Maximilian I of Mexico with support from the Catholic clergy and the conservative Mexicans. This Second Mexican Empire was victorious for only a few years, when the previous president of the Republic, the Zapotec Indian Benito Juárez, managed to restore the republic in 1867.
20th and 21st centuries
Porfirio Díaz, a republican general during the French intervention, ruled Mexico from 1876–1880 and then from 1880–1911 in five consecutive reelections. The period of his rule is known as the Porfiriato, which was characterized by remarkable economic achievements, investments in art and sciences, but also of huge economic inequality and political repression. An obvious and preposterous electoral fraud that led to his fifth reelection sparked the Mexican Revolution of 1910, initially led by Francisco I. Madero. Díaz resigned in 1911 and Madero was elected president but overthrown and murdered in a coup d’état in 1913 led by a conservative general named Victoriano Huerta after a secret council held with the U.S. ambassador Henry Lane Wilson. This re-ignited the civil war, with participants such as Pancho Villa and Emiliano Zapata who formed their own forces. A third force, the constitutional army led by Venustiano Carranza, managed to bring an end to the war, and radically amended the 1857 Constitution to include many of the social premises and demands of the revolutionaries into what was eventually called the 1917 Constitution. Carranza was killed in 1920 and succeeded by another revolutionary hero, Álvaro Obregón, who in turn was succeeded by Plutarco Elías Calles. Obregón was reelected in 1928 but assassinated before he could assume power. In 1929, Calles founded the National Revolutionary Party (PNR), later renamed the Institutional Revolutionary Party (PRI) which became the most influential party during the next 70 years.
Between 1940 and 1980, Mexico experienced substantial economic growth that some historians call “El Milagro Mexicano”, the Mexican Miracle. The assumption of mineral rights by the government, and the subsequent nationalization of the oil industry into PEMEX during the presidency of Lázaro Cárdenas del Río (1938) was a popular move, but sparked a diplomatic crisis with those countries whose citizens had lost businesses expropriated by the Cárdenas government.
Although the economy continued to flourish, social inequality remained a factor of discontent. Moreover, the PRI rule became increasingly authoritarian and at times oppressive. An example of this is the Tlatelolco Massacre  of 1968, which according to government officials claimed the life of around 30 protesters, while according to many reputable international accounts around 250 protesters were killed.
In the 1970s there was extreme dissatisfaction with the administration of Luis Echeverría which took missteps in both the national and international arenas. Nonetheless, it was in this decade that the first substantial changes to electoral law were made, which initiated a movement of democratization of a system that had become electorally authoritarian. While the prices of oil were at historically high records and interest rates were low, Mexico made impressive investments in the state-owned oil company, with the intention of revitalizing the economy, but overborrowing and mismanagement of oil revenues led to inflation and exacerbated the crisis of 1982. That year, oil prices plunged, interest rates soared, and the government defaulted on its debt. In an attempt to stabilize the current account balance, and given the reluctance of international lenders to return to Mexico given the previous default, President de la Madrid resorted to currency devaluations which in turn sparked inflation.
Former President Vicente Fox and U.S. President George Bush at the signature of the Security and Prosperity Partnership of North America.
The first small cracks in the political monopolistic position of PRI were seen in the late 1970s with the creation of 100 deputy seats in the Chamber of Deputies assigned through proportional representation with closed party-lists. Even though at the municipal level the first non-PRI mayor was elected in 1947, it was not until 1989 that the first non-PRI governor of a state was elected. However, many sources claimed that in 1988 the party resorted to electoral fraud in order to prevent leftist opposition candidate Cuauhtémoc Cárdenas from winning the national presidential elections who lost to Carlos Salinas, which led to massive protests in the capital. Salinas embarked on a program of neoliberal reforms which fixed the exchange rate, controlled inflation and culminated with the signing of the North American Free Trade Agreement (NAFTA), which came into effect in 1994. However, that very same day, the Zapatista Army of National Liberation (EZLN) started a two-week-lived armed rebellion against the federal government, and has continued as a non-violent opposition movement against neoliberalism and globalization. Being an election year, in a process that was then called the most transparent in Mexican history, authorities were reluctant to devalue the peso, a move which caused a rapid depletion of the National Reserves. In December 1994, a month after Salinas was succeeded by Ernesto Zedillo, the Mexican economy collapsed.
With a rapid rescue packaged authorized by United States President Bill Clinton and major macroeconomic reforms started by president Zedillo, the economy rapidly recovered and growth peaked at almost 7% by the end of 1999. After a comprehensive electoral reform to increase party representation during Zedillo’s administration, as well as discontent with PRI after the economic crisis, led the PRI to lose its absolute majority in the Congress in 1997. In 2000, after 71 years the PRI lost a presidential election to Vicente Fox of the opposition National Action Party (PAN). Neither party had absolute majority in the Congress.
On March 23, 2005, the Security and Prosperity Partnership of North America was signed by Vicente Fox. During the 2006 elections, the position of PRI in the Congress was further weakened and became the third political force in number of seats in the Chamber of Deputies after PAN and the Party of the Democratic Revolution (PRD), even though the party still has the plurality of state governorships. In the concurrent presidential elections, Felipe Calderón, from PAN was declared winner, with a razor-thin margin over Andrés Manuel López Obrador PRD. López Obrador, however, contested the election and pledged to create an “alternative government”.