Tehran is the capital and largest city of Iran. It is also the capital of Tehran province and the administrative center for Tehran County and its Central District. With a population of around 9 million in the city, and 15 million in the metropolitan area, Tehran is the most populous city in Iran and West Asia, the second largest metropolitan area in the Middle East after Cairo, and the 24th-most-populous metropolitan area in the world. Greater Tehran includes several municipalities, including but not limited to Karaj, Eslamshahr, Shahriar, Qods, Malard, Golestan, Pakdasht, Qarchak, Nasimshahr, Parand, Pardis, Andisheh and Fardis.
In classical antiquity, part of the territory of present-day Tehran was controlled by Rhages/Rey/Ray). Modern Ray was absorbed into the metropolitan area of Greater Tehran. Tehran was 1st chosen as the capital of Iran in 1786 by Agha Mohammad Khan of the Qajar dynasty, because of its proximity to Iran's territories in the Caucasus—which were contested in the Russo-Iranian Wars—and to avoid the vying factions of prior ruling Iranian dynasties; the capital of Iran had been moved several times throughout its long history, with Tehran becoming the 32nd. Under (1848-1896), Tehran witnessed Iran's first institute of higher learning, bank, railway line, and museum. Large-scale construction works began in the 1920s, and Tehran became a destination for mass migrations from all over Iran especially in the 20th century.