The city of Baghdad (Arabic: بغداد Baġdād) was established by the Abbasid dynasty as its capital in the 8th century, marking a new era in Islamic history after their defeat of the Umayyad Caliphate. It replaced Seleucia-Ctesiphon, a Sasanian capital 35 km southeast of Baghdad, which was virtually abandoned by the end of the 8th century. Baghdad was the center of the Caliphate during the Islamic Golden Age of the 9th and 10th centuries, growing to be the largest city worldwide by the beginning of the 10th century. It began to decline in the Iranian Intermezzo of the 9th to 11th centuries and was destroyed in the Mongolian invasion in 1258.
The city was rebuilt and flourished under Ilkhanid rule, but never rose to its former glory. It was again sacked by Timur in 1401 and fell under Turkic rule. It was briefly occupied by Safavid Persia in 1508, but fell to the Ottoman Empire in 1534. With the dissolution of the Ottoman Empire, Baghdad fell under the British Mandate in 1920 and became the capital of the independent Kingdom of Iraq in 1932 (converted to a Republic in 1958).
As the capital of the modern Republic of Iraq, Baghdad has a metropolitan area estimated at a population of 7,000,000 divided into neighborhoods in nine districts. It is the largest city in Iraq, the second-largest city in the Arab world (after Cairo) and the second-largest city in West Asia (after Tehran).