Mexico City is the capital and largest city of Mexico and the most populous city in North America. Mexico City is one of the most important cultural and financial centres in the world. It is located in the Valley of Mexico (Valle de México), a large valley in the high plateaus in the center of Mexico, at an altitude of 2,240 meters (7,350 ft). The city has 16 subdivisions, formerly known as boroughs.
The 2009 population for the city proper was approximately 8.84 million people, with a land area of 1,485 square kilometers (573 sq mi). According to the most recent definition agreed upon by the federal and state governments, the population of Greater Mexico City is 21.3 million, which makes it the second largest metropolitan area of the Western Hemisphere, the eleventh-largest agglomeration (2017), and the largest Spanish-speaking city in the world.
Greater Mexico City has a GDP of $411 billion in 2011, making Greater Mexico City one of the most productive urban areas in the world. The city was responsible for generating 15.8% of Mexico's GDP, and the metropolitan area accounted for about 22% of total national GDP. If it were an independent country, in 2013, Mexico City would be the fifth-largest economy in Latin America, five times as large as Costa Rica and about the same size as Peru.
The city had been the capital of the Aztec empire and in the colonial era, Mexico City became the capital of New Spain. The viceroy of Mexico or vice-king lived in the viceregal palace on the main square or Zócalo. The Mexico City Metropolitan Cathedral, the seat of the Archbishopric of New Spain, was constructed on another side of the Zócalo, as was the archbishop's palace, and across from it the building housing the city council or ayuntamiento of the city.
A late seventeenth-century painting of the Zócalo by Cristóbal de Villalpando depicts the main square, which had been the old Aztec ceremonial center. The existing central place of the Aztecs was effectively and permanently transformed to the ceremonial center and seat of power during the colonial period, and remains to this day in modern Mexico, the central place of the nation.
Mexico City is one of the most important economic hubs in Latin America. The city proper produces 15.8% of the country's gross domestic product. According to a study conducted by PwC, Mexico City had a GDP of $390 billion, ranking it as the eighth richest city in the world and the richest in Latin America. Mexico City alone would rank as the 30th largest economy in the world. Mexico City is the greatest contributor to the country's industrial GDP (15.8%) and also the greatest contributor to the country's GDP in the service sector (25.3%).