The Isma'ili Shi'a caliphate that ruled from 909 to 1171 CE — rising in what is now Tunisia, conquering Egypt and founding Cairo and al-Azhar, the mosque that became one of the Islamic world's great centers of learning, claiming suzerainty over the holy cities, dominating the Red Sea trade, and ending when Saladin restored nominal Abbasid-Sunni allegiance in Egypt. For more than two centuries it offered a rival claim to lead all Muslims.
For most of the tenth and eleventh centuries, Muslims faced a question with no easy answer. Two men each claimed the title of caliph, the rightful leader of the whole community after the Prophet. One sat in Baghdad and was Sunni. The other sat in Cairo and was Shi'a, and he claimed something the first did not: direct descent from the Prophet's daughter Fatima and her husband Ali. He governed Egypt, the North African coast, and the cities of Mecca and Medina. His coins passed through ports from the Red Sea to the western Mediterranean. This was not a sect at the margins. It was a second center of the Islamic world, ruling some of its richest land.