Mexico City is the capital and largest city of Mexico, as well as the most populous city in North America, and is one of the country’s 32 federal entities. Mexico City is one of the most important cultural and financial centers 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 demarcaciones territoriales, subdivisions colloquially known as alcaldías or boroughs.
The 2020 population for the city proper was 9,209,944, 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,804,515, which makes it the sixth-largest metropolitan area in the world, the second-largest urban agglomeration in the Western Hemisphere (behind São Paulo, Brazil), and the largest Spanish-speaking city (city proper) in the world.
Greater Mexico City has a GDP of $411 billion in 2011, which makes it 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 the country’s GDP. If it were an independent country in 2013, Mexico City would be the fifth-largest economy in Latin America.
Mexico’s capital is both the oldest capital city in the Americas and one of two founded by indigenous people. The city was originally built on a group of islands in Lake Texcoco by the Mexica (Azteca) in 1325 as Tenochtitlan. It was almost completely destroyed in the 1521 Siege of Tenochtitlan and subsequently redesigned and rebuilt in accordance with the Spanish urban standards. In 1524, the municipality of Mexico City was established, known as México Tenochtitlán, and as of 1585, it was officially known as Ciudad de México (Mexico City). Mexico City was the political, administrative, and financial center of a major part of the Spanish colonial empire. After independence from Spain was achieved, the federal district was created in 1824.
After years of demanding greater political autonomy, residents were finally given the right to elect both a head of government and the representatives of the unicameral Legislative Assembly by election in 1997. Ever since, left-wing parties (first the Party of the Democratic Revolution and later the National Regeneration Movement) have controlled both of them. The city has several progressive policies, such as abortion on demand, a limited form of euthanasia, no-fault divorce, and same-sex marriage.
On 29 January 2016, it ceased to be the Federal District (Spanish: Distrito Federal or D.F.) and is now officially known as Ciudad de México (or CDMX), with a greater degree of autonomy. A clause in the Constitution of Mexico, however, prevents it from becoming a state within the Mexican federation, as it is the seat of power in the country, unless the capital of the country were to be relocated elsewhere.
Source:  Mexico City – Wikipedia