Hamdanid dynasty
Ahmad ibn Tulun, a dissenting Turkish governor appointed by the Abbasids, conquered Syria, including Damascus, from his overlords in 878–79. In an act of respect for the previous Umayyad rulers, he erected a shrine on the site of Mu'awiya's grave in the city. Tulunid rule of Damascus was brief, lasting only until 906 before being replaced by the Qarmatians who were adherents of Shia Islam. Due to their inability to control the vast amount of land they occupied, the Qarmatians withdrew from Damascus and a new dynasty, the Ikhshidids, took control of the city. They maintained the independence of Damascus from the Arab Hamdanid dynasty of Aleppo and the Baghdad-based Abbasids until 967. A period of instability in the city followed, with a Qarmatian raid in 968, a Byzantine raid in 970, and increasing pressures from the Fatimids in the south and the Hamdanids in the north.