After the reigns of al-'Aziz and al-Hakim, the long reign of al-Mustansir entrenched a regime in which the caliph remained aloof from state affairs and viziers took on greater importance. Political and ethnic factionalism within the army led to a civil war in the 1060s, which threatened the empire's survival. After a period of revival during the tenure of the vizier Badr al-Jamali, the Fatimid caliphate declined rapidly during the late eleventh and twelfth centuries. In addition to internal difficulties, the caliphate was weakened by the encroachment of the Seljuk Turks into Syria in the 1070s and the arrival of the Crusaders in the Levant in 1097. In 1171, Saladin abolished the dynasty's rule and founded the Ayyubid dynasty, which incorporated Egypt back into the nominal sphere of authority of the Abbasid Caliphate.
After the reigns of al-'Aziz and al-Hakim, the long reign of al-Mustansir entrenched a regime in which the. caliph remained aloof from state affairs and viziers took on greater importance. Political and ethnic factionalism within the army led to a civil war in the 1060s, which threatened the empire's survival. After a period of revival during the tenure of the vizier Badr al-Jamali, the Fatimid caliphate declined rapidly during the late eleventh and twelfth centuries In addition to internal difficulties, the caliphate was weakened by the encroachment of the Seljuk Turks into Syria in the 1070s and the arrival of the Crusaders in the Levant in 1097. In 1171, Saladin abolished the dynasty's rule and founded the Ayyubid dynasty, which incorporated Egypt back into the nominal sphere of authority of the Abbasid Caliphate.