section_path: History/Medieval and pre-modern times
section_name: Medieval and pre-modern times
paragraph_text: Medieval and pre-modern times
  
  Mecca was never the capital of any of the Islamic states. Muslim rulers did contribute to its upkeep, such as during the reigns of ' Umar (r. 634–644 CE) and ' Uthman ibn Affan (r. 644–656 CE) when concerns of flooding caused the caliphs to bring in Christian engineers to build barrages in the low-lying quarters and construct dykes and embankments to protect the area around the Kaaba.
  
  Muhammad's return to Medina shifted the focus away from Mecca and later even further away when ' Ali, the fourth caliph, took power and chose Kufa as his capital. The Umayyad Caliphate moved the capital to Damascus in Syria and the Abbasid Caliphate to Baghdad, in modern-day Iraq, which remained the center of the Islamic Empire for nearly 500 years. Mecca re-entered Islamic political history during the Second Fitna, when it was held by Abdullah ibn az-Zubayr and the Zubayrids. The city was twice besieged by the Umayyads in 683 CE and 692 CE, and for some time thereafter, the city figured little in politics, remaining a city of devotion and scholarship governed by various other factions. In 930 CE, Mecca was attacked and sacked by Qarmatians, a millenarian Shi'a Isma'ili Muslim sect led by Abū-Tāhir Al-Jannābī and centered in eastern Arabia. The Black Death pandemic hit Mecca in 1349 CE.