 The Fatimid Caliphate originated in an Ismaili Shia movement launched in al @-@ Salamiyah , on the western edge of the Syrian Desert , by Abd Allah al @-@ Akbar , a claimed eight generation descendant of the Islamic prophet Muhammad , through the prophet 's daughter Fatimah . In 899 his grandson , to be known as Abd Allah al @-@ Mahdi , became leader of the movement . He fled from his enemies to Sijilmasa in Morocco , where he proselytized under the guise of being a merchant . He was supported by a militant named Abu Abd Allah al @-@ Shi 'i , who organized a Berber uprising that overthrew the Tunisian Aghlabid dynasty , and then invited al @-@ Mahdi to assume the position of imam and caliph . The empire grew to include Sicily and to stretch across North Africa from the Atlantic to Libya . The Fatimid caliphs built three capital cities , which they occupied in sequential order : Mahdia ( 921 – 948 ) and al @-@ Mansuriya ( 948 – 973 ) in Ifriqiya and Cairo ( 973 – 1169 ) in Egypt . 
