 During the late eleventh and twelfth centuries the Fatimid caliphate declined rapidly, and in 1171 Saladin invaded its territory.He founded the Ayyubid dynasty and incorporated the Fatimid state into the .The Fatimid Caliphate's religious ideology originated in an Ismaʻili dawah (movement) launched in the ninth century in Salamiyah, Syria by the eighth Ismaili Imam, Ahmad al-Wafi (766–828).