Many of the dynasties which arose under ‘Abbasid caliphate, while being relatively independent, were content to recognize the ‘Abbasid caliph as the supreme head of the Islamic empire. But around the 10th century, this continuity was challenged by the Fatimids of Tunisia (where it arose in 909) and later in Egypt (conquered in 969). Being Shi’ites, the Fatimids refused to recognized the rule of the ‘Abbasids, who were Sunni’s. They established their separate caliphate in North Africa, Egypt, Syria and Western and Southern Arabia. At the same time, the Umayyad Amir in Cordoba, Spain proclaimed himself as caliph also, mostly done in self-protection from Fatimid and ‘Abbasid aggression.
The Umayyad caliphate of Cordoba finally came undone in 1031, breaking up into a number of smaller local dynasties. In 1171, a Kurdish officer named Saladin overthrew the Fatimid dynasty, which had been in decline for a long time. He established the Ayyubid dynasty which ruled Egypt, Palestine and Syria for about 200 years until the 13th century when it gradually merged into the Mamluk Sultanate.