The city now known as Mexico City was founded as Tenochtitlan by the Aztecs in 1325 and a century later became the dominant city-state of the Aztec Triple Alliance, formed in 1430 and composed of Tenochtitlan, Texcoco, and Tlacopan. At its height, Tenochtitlan had enormous temples and palaces, a huge ceremonial center, residences of political, religious, military, and merchants. Its population was estimated at least 100,000 and perhaps as high as 200,000 in 1519 when the Spaniards first saw it.
During the final stage of the Spanish conquest of the Aztecs, Tenochtitlan was besieged and essentially razed. Hernán Cortés understood the strategic and symbolic importance of the Aztec capital and founded the Spanish capital of Mexico City on the site, and in particular rebuilt the Aztec ceremonial and political center as the main square, the Plaza Mayor, usually called the Zócalo. Some of the oldest structures in Mexico City date from the early conquest era. Many colonial-era buildings remain standing and have been re-purposed government buildings and museums. As the seats of the Viceroyalty of New Spain and the Archbishopric of New Spain, Mexico City was the center of political and religious institutions, but it was also the center of Mexico's economic activity and the residence of social elites in colonial Mexico (1521–1821). It was where the great merchant houses were located and the economic elites of the country lived, even if their sources of wealth were elsewhere. The concentration of mansions and palaces in what is now the Mexico City historic center led it to be nicknamed, the "City of Palaces", a sobriquet often attributed to great savant Alexander von Humboldt, perhaps in error. It was also a major educational center, with the University of Mexico founded in 1553 as part of the complex of the Plaza Mayor. The crown-approved attempt to train Nahua men to become Christian priests saw the establishment in 1536 of the Colegio de Santa Cruz de Tlatelolco in one of the two sections of the capital governed by a Nahua city council (cabildo). Many religious institutions for the education of the sons of Spanish elites were also based in the capital. Mexico City had the colony's largest concentration of those of Spanish heritage (both Iberian-born peninsulares and American-born criollos), as well as the largest concentration of mixed race casta population in the colony. Many Indians also lived outside the center of the capital.