The Rightly Guided Caliphs are five: Abu Bakr, 'Umar, 'Uthman, 'Ali and al-Hasan.
The first of the caliphs of the Banu Umayya was Mu'awiya and the last of them was Marwan, nicknamed al-Himar (“the Ass”); they were fourteen.
The first of the caliphs of the Banu [fol. 273b] l-'Abbas was 'Abd Allah ibn Muhammad ibn 'Ali ibn 'Abd Allah ibn al-'Abbas ibn 'Abd al-Muttalib. Allegiance was sworn to him as caliph on Friday, the thirteenth of the month of Rabi' al-Awwal, in the year 132.
His grandfather 'Ali ibn 'Abd Allah ibn 'Abbas, on the night he was born, was brought in with his father 'Abd Allah ibn 'Abbas to 'Ali ibn Abi Talib; it was the night on which 'Ali was killed. 'Ali said to him: “Take to yourself the father of the forty caliphs.”
Muhammad ibn 'Ali, the father of al-Saffah 'Abd Allah, had received allegiance secretly in the year 100, in the days of 'Umar ibn 'Abd al-'Aziz; the call (da'wa) on his behalf was in Khurasan, and that was during the lifetime of his father 'Ali.
A group came in to this Muhammad in the year 125, and he said to them: “I shall die in this year of mine, and your man is my son Ibrahim, though he will be killed. When God Most High has carried out His decree upon him, your man is my son 'Abd Allah, the son of the Harithi woman” — meaning al-Saffah — “he is the one who will undertake this affair, and the destruction of the Banu Umayya will be at his hand.” And he died.
The call passed to his son Ibrahim, and Marwan al-Himar killed him in the year 131. He had appointed his brother 'Abd Allah al-Saffah as his successor.
The first of the caliphs of the Fatimids was Abu Muhammad 'Ubayd Allah ibn al-Hasan al-Mahdi. Allegiance was sworn to him in the year 298; his rising was from al-Qayrawan in the West (al-Gharb). He claimed to be a descendant of Isma'il ibn Ja'far ibn Muhammad ibn 'Ali ibn al-Husayn ibn 'Ali ibn Abi Talib, but his lineage is disputed. His appearance was at that time during the caliphate of al-Muqtadir bi-llah the 'Abbasid, who was in Baghdad. He established his state in the West; then al-Qa'im bi-llah after him, then his son al-Mansur.
The rest of them resided in Egypt. The first of them there was al-Mu'izz li-Din Allah Abu Tamim al-Ma'add ibn Isma'il ibn Muhammad al-Mahdi. Allegiance was sworn to him as caliph after his father al-Mansur in al-Mahdiyya in the year 341. Then he went out to Egypt in the year
358 and took control of it. He is the one who built Cairo. He was born in the year 319, lived forty-five years and seven months, and died in his bed in Rabi' al-Akhir in the year 365. He was buried in the Qarafa of Egypt.
The last of them was al-'Adid li-Din Allah. He died in his bed in the year 567 and was buried in the palace in Cairo, at the place known as Dar al-Darb (the Mint).
The Fatimids were fourteen caliphs.