Adapted from Al-Bidâyah wa An-Nihâyah of Al-Imâm Ibn Katheer
The number of the caliphs that ruled up to the time of Al-Musta'sim were 37. Their first was Abdullah As-Saffaah (the blood spiller), he was given the allegiance as the Caliph and began to rule in year 132 Hijrah. He came to power after the Umayyad Dynasty was sacked, as mentioned.
The last of the Abbasid caliphs was Abdullah Al-Musta'sim; the total number of the period of their rulership was 524 years. Their rulership was sacked in Iraq, and finally, in a period that lasted a year and some months in the days of Al-Basaasir after 450, then the matter went back to what it used to be.
The Fatimid Dynasty went on for about three hundred years until their last ruler, Al-Aadid, died. He died after 560 Hijrah during the reign of As-Saalihiyyah An-Naasiriyyah Al-Qadisiyyah, as mentioned. The total number of the Fatimid Kings were 14, at different times. Their reign absolutely lasted 297 years until the death of Al-Aadid in year 560 and some few years.
It is wondrous that the caliphacy that followed the death of the Messenger of Allâh (Sallalahu alayhi wa sallam) lasted (just) thirty years, as mentioned in an authentic hadith. In that period of caliphacy, Abu Bakr was there then Umar, then Uthman then Alee followed by his son, Al-Hasan, who ruled for six months (may Allâh be pleased with all of them); until the thirty years were completed, as we have said in our work Dalaailun-Nubuwwah (the Indicators of Prophethood).
Then after that period, monarchical rule came in. The first king of Islam was from the children of Aboo Sufyaan, Muaawiyah bn Abee Sufyaan – Sakhr bn Har'b bn Umayyah. Then followed by his son, Yazeed. Then his grandson, Muaawiyah bn Yazeed bn Muaawiyah. Thus the chain that began with Muaawiyah and ended with Muaawiyah came to an end.
Then began the line of kings from Mar'waan bn Al-Hakam, followed by his son, Abdul-Malik; then Al-Waleed bn Abdul-Malik, then his brother, Sulayman, then his cousin, Umar bn Abdul-Azeez [popularly called Umar II]; then followed by Yazeed bn Abdul-Malik; then Hishaam bn Abdul-Malik; then Al-Waleed bn Yazed bn Al-Waleed; then his brother, Ibrahim An-Naaqis who was also a son of Al-Walid; then followed by Mar'waan bn Muhammad bn Mar'waan who was nicknamed Al-Himaar (the Donkey); thus he was their last. Their first was by name Mar'waan and their last also by the name Mar'waan [Allaah is Great!]. Thus that was the end of their chain.
The first caliph in the line of the children of Al-Abbaas was Abdullah As-Saffaah (the blood spiller); their last was Abdullah Al-Musta'sim.
So also the first caliph in the line of the Fatimids was by name Abdullah Al-Aadid and their last was by name Abdullah Al-Aadid.
The foregoing is a very rare coincidence; those who will ponder over it are few. It is Allâh the Blessed that knows better.
Below is a blank verse written by one of the honourable ones wherein he mentioned all the caliphs:
Praise to Him Whose Throne is a Mighty
 The Irresistible, the Only One, and the Powerful in His Grasp
 He that changes the days and years
 And that (will) collect all the mankind on (the Day of) Resurrection
 Then may an everlasting benediction
 Be upon the Prophet, Al-Mustafa Muhammad
 Also on his family and his Honourable Companions
 Those who were masters, scholars and dignitaries (in the Deen)
 To proceed, this is a blank verse
 That I composed in with meekness and brevity
 I composed there (the names) of the guided caliphs
 That came after the Prophet Al-Mustafa
 And those who followed then and so on
 I made it an enlightenment and admonition
 The first person given allegiance as a caliph
 After the Prophet was the son of Abu Quhaafah
 I mean the Imam, the guide and As-Siddeeq
 Then after him he was pleased with Al-Faaruq
 Who liberated towns and cities
 His swords extirpated the unbelievers
 He stood and ruled with justice in a manner well-pleased
 By Allâh the Absolute Ruler in the heaven and earth
 And people were pleased with the Possessor of the Two Lights
 Then Alee the father of the two grandsons
 Then came the battalion with Al-Hasan
 They nearly renewed with it the tribulation
 But Allâh brought peace through him
 As our Prophet had attributed that to him
 And the people gathered under Muaawiyah
 And every reporter began to transmit the story
 Thus he controlled the reign as he wanted
 And after him came Yazeed
 Then his son; and he was pious and guided
 I mean Abu Layla; and he was an ascetic
 And the son of Az-Zubayr in Hejaz working hard
 On getting the power; it was on that he was toiling
 In Shaam, the people there paid allegiance to Mar'wan
 By the Decree of He that would say be and it would be
 He did not stay in power beyond a year
 He was cut short (in life) by the sharpest arrow
 Thus the power was entrusted Abdul-Malik
 The fire of the star of his success in the space
 And everyone that disputed the power with him
 Was left sprawling on the floor by the sword of destruction
 He killed Al-Mus'ab in Iraq
 He made Al-Hajjaaj the person of harm to walk
 To Hejaz with punitive swords
 While the son of Az-Zubayr was seeking refuge in the Haram
 He departed after killing him to still crucify him
 And he never cared about his affair from his Lord
 Then came after him Al-Waleed
 Then Sulayman the guided chap
 Then flowed in mankind the just Umar
 Who followed the command of his Lord as He commands
 He was called the most reserved among the people
 A person of Salat, piety and fasting
 Then came justice and fairness
 And the people of oppression and authoritarianism were restrained
 In accordance with the Sunnah of the Messenger
 And the Righteous Caliphs the People of Intellect
 Then came Yazeed after him after whom was Hishaam
 Then Al-Walid who was thoughtless
 Then came Yazid who was called An-Naaqis (the Uncompleted)
 His death came to cut his life short
 The reign of Ibrahim was not long
 And all his affair was sickly
 Then the monarchy was taken to Mar'wan
 Whose matter became as it became
 In him came the end of the Family of Al-Hakam
 And the splendor of office was seized from them
 Then came the reign of the children of Al-Abbaas
 The root of the foundation would not collapse under us
 Their first was the one nicknamed As-Saffaah (the Butcher)
 And after him was Al-Mansoor the person of success
 Then came after him Al-Mahdee
 Who was followed by Musa the guide the pure
 Then came Haarun Rashid
 Then came Al-Ameen when he tasted his absence
 Then came after his death Al-Ma'mun
 And after him was Al-Mu'tasim Al-Makeen
 And Al-Waathiq was made the Caliph after Al-Mu'tasim
 Then his brother, Jafar, the provider of security
 He rebutted heresies in his own time
 And Sunnah was upheld in his epoch
 No misleading act of innovation was allowed to live
 He wore the cloth of disgrace over the Mu'tazilah
 It was when he became a martyr that Al-Muntasir came on board
 Then Al-Mustaeen came after him as it was mentioned
 And after his death came Al-Mu'tazz
 And Al-Muhtadi Al-Muktazim Al-A'azz
 And after him Al-Mu'tamid assumed the reign of authority
 Al-Mu'tamid extended the tentacle of his authority and was good as an administrator
 Al-Muktafi is well-remembered in the Higher Scrolls
 After him went the rulership of Al-Mutadir
 And the power went to Izzul-Qaahir
 After him was Ar-Raadi the brother of Al-Mufaakhir
 Then Al-Mutaqii after Dhul-Mustakfi
 Then Al-Muti'i who had no successor
 Then obedience reigned then came Al-Qaadir
 Then the upright the ascetic that was Ash-Shaakir
 Then after him Al-Muqtadi after whom was Al-Mustandhir
 Then came Al-Mustar'shid Al-Muwaqqar
 After him was Ar-Raashid then Al-Muqtafi
 And when he died did a recourse was made to Yusuf
 Who was called Al-Mustadi'u and who was just in his acts
 And who was truthful in his speech
 He was a magnanimous helper and severely courageous
 And his reign among the people was a long one
 Then he was followed by Adh-Dhaahir Al-Karim
 Whose sense of justice was known to all
 His days in reign did not last long
 Just some few months before he met his end
 His word was for Al-Mustansir
 Who was just, pious, generous in root
 He ruled people for seventeen (years)
  And some months with pious resolution
 Then he died in his forties
 And it was in the month of Jumadal that he came across his death
 Then people made allegiance to Al-Musta'sim
 May our Lord pour peace and benediction on him
 The number of the Fatimids were little
 But they ruled for a long period of time
 They ruled for sixty years and few other years
 From after two hundred it was like a year
 Their number was fourteen (for) Al-Mahdee
 And for al-Mansur Al-Ma'di the shrewd
 I mean by that Al-Maizz the founder of Cairo
 Then Al-Aziz Al-Haakim Al-Kawafir
 And Adh-Dhaahir Al-Mustansir Al-Musta'li
 Then Al-Aamir Al-Haafidh who was evil in deed
 And Adh-Dhaafir Al-Faaiz then Al-Aadid
 Their last; and there is no dispute over this (fact)
 He died sixty years and some
 Before it was five hundred years

