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 Sassanid 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 Golden Age of Islam 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-speaking regions (after Cairo) and the second-largest city in Western Asia (after Tehran). Early history Baghdad was founded on 30 July 762 CE. It was designed by caliph Al-Mansur. According to 11th-century scholar Al-Khatib al-Baghdadi in his History of Baghdad, each course of the city wall consisted of 162,000 bricks for the first third of the wall's height. The wall was 80 ft high, crowned with battlements and flanked by bastions. A deep moat ringed the outer wall's perimeter. Thousands of architects, engineers, legal experts, surveyors, carpenters, blacksmiths, diggers, and laborers from across the Abbasid empire were brought in to survey, measure, and excavate the foundations. Ya'qubi, in his Book of Countries, thought there were 100,000 workers involved. "They say that no other round city is known in all the regions of the world," according to Al-Khatib al-Baghdadi. Four equidistant gates pierced the outer walls where straight roads led to the center of the city. The Kufa Gate to the south-west and the Basra Gate to the south-east both opened onto