Analysis of information sources in references of the Wikipedia article "รัฐเคาะลีฟะฮ์ฟาฏิมียะฮ์" in Thai language version.
In the course of the later eleventh and twelfth century, however, the Fatimid caliphate declined rapidly, and in 1171 the country was invaded by Ṣalāḥ ad-Dīn, the founder of the Ayyubid dynasty. He restored Egypt as a political power, reincorporated it in the Abbasid caliphate and established Ayyubid suzerainty not only over Egypt and Syria but, as mentioned above, temporarily over northern Mesopotamia as well.
Nevertheless, the Seljuqs of Syria kept the Crusaders occupied for several years until the reign of the last Fatimid Caliph al-Adid (1160–1171) when, in the face of a Crusade threat, the caliph appointed a warrior of the Seljuq regime by the name of Shirkuh to be his chief minister.