Abbasid Caliphate

The Abbasid Caliphate was the third of the four greatest Islamic caliphates of the Arab Empire. It overthrew the Umayyad caliphs from all but Al-Andalus. It was built by the descendant of Muhammad's youngest uncle, Abbas ibn Abd al-Muttalib. It was created in Harran in 750 of the Christian era and shifted its capital in AD 762 from Harran to Baghdad. It flourished for two centuries, surviving the Zanj Rebellion (869-883). Abbasid rule was ended in 1258, when Hulagu Khan, the Mongol conqueror, sacked Baghdad. But they continued to claim authority in religious matters from their base in Egypt.
During the period of the Abassid dynasty, Abassid claims to the caliphate did not go unchallenged. The Ubayd Allah al-Mahdi Billah of the Fatimid dynasty, which claimed descendency of Muhammad through his daughter, claimed the title of Caliph in 909 and created a separate line of caliphs in North Africa. Initially it covered only Morocco, Algeria, Tunisia and Libya, but then the Fatimid caliphs extended their rule for the next 150 years, taking Egypt and Palestine and even ancient Pakistan, before the Abbassid dynasty was able to turn the tide, limiting Fatimid rule to Egypt. The Fatimid dynasty finally ended in 1171. The Umayyad dynasty, which had survived and come to rule over the Muslim provinces of Spain, reclaimed the title of Caliph in 929, lasting until it was overthrown in 1031.
The tenth caliph, namely Al-Mutawakkil, is the person who oversaw the introduction of hadiths.