People had been living in the Valley of Mexico for many centuries before the arrival of the Aztecs in the thirteenth century and the conquering Spaniards soon after that. The basin had no natural outlet and several lakes formed in the valley, attracting inhabitants to their shores. Not far from present-day Mexico City, more than 100,000 people lived in Teotihuacán, the "Place of the Gods," before it was inexplicably abandoned around A.D. 750. Many other groups moved in and out of the valley. Several lakeside communities, some with 10,000 to 15,000 residents, flourished in the Valley of Mexico during pre-Columbian times.
According to oral history, the Aztecs were a nomadic tribe. Unskilled and barbaric, they were not welcomed by the inhabitants of the Valley of Mexico when they arrived there in the thirteenth century. They were forced to move from one place to another along the western shore of salty Lake Texcoco, and they ate whatever they could find, including mosquito larva, snakes, and other vermin. In time, the Aztecs settled on some swampy islands on the western shores of the lake. According to legend, the Aztec war god Huitzilopochtli led them to this place. They knew they were home after seeing an eagle perched on a cactus devouring a serpent (today, this national emblem is on the Mexican flag). From here, the Aztec city of Tenochtitlán spread over the marshes, swamps, and islands.
In 1428, in an alliance with several valley communities, the Aztecs defeated the dominant city of Azcapotzalco. Until then, the Aztecs, known for their viciousness, had served as mercenaries (hired soldiers) for the Tepanecs, the people of Azcapotzalco. To maintain power after their victory, the Aztecs joined a triple alliance with the valley cities of Texcoco and Tlacopan. The three cities exacted tribute (money and goods in exchange for protection) from surrounding communities, but it was Tenochtitlán that rose to become an
By the time Spanish explorer and soldier Hernán Cortés traveled from Cuba to Tenochtitlán in 1519, the city had grown to more than 100,000 people. It was, in the words of the conquering Spaniards, an amazing city of fertile gardens, canals, and massive temples, more beautiful than any European city. Tenochtitlán was connected to the mainland by three large causeways (bridges) that converged on the ceremonial center, near Emperor Moctezuma II's palace and the main temple.
Moctezuma, who believed Cortés was the returning god Quetzalcóatl, welcomed the Spaniards into the city. He was soon their prisoner, however, and died in 1520. The Aztecs then embarked on a futile defense of their city against the Spaniards and their allies, native peoples like the Tlaxcalans, who had been earlier defeated by the Aztecs. Tenochtitlán was heavily damaged during the final battle on August 13, 1521, with Cuauhtémoc, the last of the Aztec kings, leading its defense.
Cuauhtémoc, who is now considered a revered national hero, was later tortured and executed. Cortés ordered the surviving Aztecs out of the city and razed Tenochtitlán. Over its remnants, he began to build a Spanish city he called Mexico. The city was established, and Spain recognized its cabildo (town council) in 1522. The territory became known as New Spain.
By the 1530s, Mexico City was given jurisdiction (rule) over other cabildos of New Spain and quickly established itself as the most important city in the Americas. Like that of the Aztecs, the Spaniards' grasp extended well beyond the Valley of Mexico—only much farther. At one point, Mexico City ruled a territory that extended south to Panama and north to California.
By the 1560s, diseases introduced by the Europeans, war, and indentured labor (a contract binding a person to work for another for a given length of time) had decimated Mexico's native population to one-third of its former size. The wealth taken from New Spain allowed Cortés and those who followed him to build an impressive city. By the eighteenth century, Mexico City's architecture was renowned, and often compared with the best Europe had to offer. For a period, Mexico City remained by the lakeside. But flooding became a constant problem. After 1629, when several thousand people died in floods, Lake Texcoco and surrounding lakes were drained or filled in. Yet flooding still remained a problem at the turn of the twenty-first century.
Mexico gained its independence from Spain in 1821, after a long war. The republican constitution of 1824 established Mexico City as the nation's capital. Unrest followed for the next several decades, as different factions fought for control of Mexico. In 1847, during the Mexican-American War, U.S. troops captured Mexico City and forced a peace treaty on the country. By the 1850s, Mexico's rulers tried to curb the power of the Catholic Church. The city's convents were destroyed or turned to other uses. Since then, Mexico's government has maintained an uneasy relationship with the Vatican (the seat of the Roman Catholic Church).
Through the turmoil, the only constant was continued growth, with wealth and power growing increasingly more concentrated in Mexico City. Porfirio Díaz, who ruled the nation for more than three decades (1876–1910), developed the city's infrastructure (the basic facilities on which the growth of a community depends, such as roads, schools, transportation, and communication systems), encouraged foreign investment, and laid the groundwork for industrial development. By the early twentieth century, Mexico City was becoming a modern city, with gas and electric lighting, streetcars, and other modern amenities. Yet, Díaz's dictatorial, often cruel, regime concentrated land and wealth in the hands of a few people. The majority of the nation languished in poverty. Social injustice led to nationwide revolts, and ultimately the Mexican Revolution (1910–17). The city was not untouched by the revolution. Battles were fought on its streets, and thousands of displaced villagers sought refuge in the city. During the war, Mexico City was held briefly by the famous revolutionaries Ernesto "Pancho" Villa and Emiliano Zapata. Yet, Mexico City's national eminence was unaffected by the revolution. The city continued to modernize at a rapid pace. Old palaces and colonial homes were demolished to make way for new roads and modern buildings. By 1924, Avenida Insurgentes, considered today one of the world's longest avenues, was being laid out.
By the late 1920s, the Institutional Revolutionary Party (PRI) was well on its way to becoming the most powerful political force in the nation. From Mexico City, it would rule the nation as a de facto (existing in fact though not by legal establishment) one-party state for the next 70 years. Under the PRI, political power became more centralized in Mexico City, which continued to benefit at the cost of other regions in the nation. By 1930, Mexico City had grown to one million and continued to prosper after World War II (1939–45). But the strains of rapid growth were beginning to show. In 1968, Mexico City hosted the Summer Olympic Games and two years later the Soccer World Cup. Both events were meant to signal the prosperity of a developing nation, but serious problems had been masked by the PRI's authoritarian regime. In 1968, government troops massacred an unknown number of protesting students at a Mexico City housing complex. Mexican historians believe the massacre eventually unraveled the PRI's hold on the nation and led to dramatic political changes by the 1990s.
Under relentless growth, Mexico City had lost its charm by the 1970s, when the government could barely keep up with services. The collapse of oil prices starting in 1982 further curtailed public spending (Mexico is the leading producer of crude oil outside of the Persian Gulf; the Mexican government uses the great oil revenue to finance public spending). Mexico City was choking in the smog and pollution. In 1985, a massive earthquake shook the city, killing at least 7,000 people and destroying dozens of buildings. Villagers from the countryside who continued to pour into the city to escape poverty only compounded the city's problems. With no housing available, they took over lands surrounding the city, creating huge shantytowns that extended for many miles. By the mid-1990s, the city was suffering through a debilitating crime wave that only seemed to increase each day.
In 1997, Cuauhtémoc Cárdenas, a member of the Party of the Democratic Revolution, became the first elected mayor of Mexico City, dealing a major blow to the PRI, which had ruled the city without interruptions since 1928. Cárdenas promised a more democratic government, and his party claimed some victories against crime, pollution, and other major problems. He resigned in 1999 to run for the presidency. Rosario Robles Berlanga, the first woman to hold the mayoral post, promised she would continue to reverse the city's decline.