The Ayyubid dynasty was founded by Salah Ad-Din Al-Ayyubi, who defeated and expelled the Fatimids in 567 AH/ 1174 A.D , and Egypt returned under the Abbasid Caliphate once more. Salah Ad-Din worked on spreading the Sunni doctrine instead of Shiism that was common in the Fatimid period. The Ayyubid dynasty was a military state as it appeared during the turbulent time of crusader attacks on Egypt and the Levant (Ash-sham). In light of this political context, Salah al-Din decided to build a citadel in Cairo, the construction of which began in 527 AH/ 1176 A.D. Its completion, however, did not take place during his lifetime, but later in 1208 A.D. In addition to this, Egypt’s rule extended to the Levant (Ash-sham) , the Hijaz, Yemen, Nubia, and parts of North Africa. Ayyubid Reign stayed in Egypt for 81 years and ended on the hands of the Mamelukes.