Ahmadi Muslims believe that the Ahmadiyya caliphate is the resumption of the Rightly Guided Caliphate. The Ayyubid dynasty overthrew the Fatimid Caliphate in Egypt. Manicheans also suffered persecution for some time under the Abbasid Caliphate of Baghdad. Muslim intellectuals would become experts in chemistry, optics, and mapmaking during the Abbasid Caliphate. Elpidius fled to Africa, where he defected to the Abbasid Caliphate. They were opponents of the Abbasid Caliphate. The city became part of the Emirate of Armenia under the Umayyad Caliphate. At the time, Cairo was second only to Baghdad, capital of the rival Abbasid Caliphate. There was no clearly accepted formula for determining succession in the Abbasid caliphate. However, Sunni Muslims believe this was after the 'rightly guided' Rashidun caliphate ended. The Jarudiyya were active during the late Umayyad Caliphate and early Abbasid Caliphate. Relations with the Abbasid Caliphate were rocky for the Hanbalites. These conquests were part of the expansion of the Umayyad Caliphate. During the Crusades it was under the control of Fatimid Caliphate. The madrasa is one of the relics of the Fatimid caliphate.