Hadith of the twelve successors

The hadith of the twelve successors is a widely-reported prophecy, attributed to the Islamic prophet Muhammad, predicting that there would be twelve successors after him. As there were many more rulers after Muhammad, Sunni authors have variously identified these twelve successors with some of these rulers. In Twelver Shia, these successors are instead identified with their Twelve Imams. Their last imam, Muhammad al-Mahdi, is believed to miraculously remain in occultation since 874 CE, and is expected to return in the end of times to eradicate injustice and evil.

Sunni sources
Several variants of the hadith of twelve successors appear in Sunni sources, usually related on the authority of Jabir ibn Samura, a companion of the Islamic prophet Muhammad, but also narrated from other companions, such as Abd Allah ibn Mas'ud , Anas ibn Malik , Umar , Wasila ibn Asqa', Abd Allah ibn Umar , Abu Huraira , Salman the Persian , Aisha , and Uthman. In particular, the Sunni jurist Ahmad ibn Hanbal furnishes this hadith with thirty-four chains of transmission, all of which lead to Jabir ibn Samura. A version of this hadith in the canonical Sunni compilations Sahih al-Bukhari and Sahih Muslim quotes Muhammad,

"There will be twelve successors ( khalifa) after my death, all of them from the [tribe of] Quraysh."

In fact, Sahih Muslim dedicates a whole section to variants of this hadith, and such statements are also cited by Sunni scholars Na'im ibn Hammad, al-Tirmidhi , al-Tabarani , al-Hakim al-Nishapuri , and Ibn Asakir. A version of the hadith cited by the Sunni traditionist Abu Dawud adds that the Islamic community would be united during the reign of these twelve successors. Another version in Sahih Muslim reads similarly, "People's affairs will be properly conducted as long as twelve men will lead them." Therein another close variant is, "This religion [Islam] will be exalted as long as there are twelve successors." Yet another version of the hadith predicts that anarchy and turmoil would prevail after the reign of these twelve successors. Some versions even imply that the world will end after these twelve successors. For instance, a version of the hadith quoted by Abu Dawud reads, "This religion [Islam] will exist as long as there exist twelve successors from the Quraysh," which implies that the total lifespan of these twelve successors extends to the end of time. In some versions of this hadith, amir (lit. 'commander') or qayyim (lit. 'guardian') or imam appear instead of khalifa. In another version, these twelve successors are compared to the twelve leaders (al-nuqaba) of the Bani Isra'il. In favor of its authenticity, the Islamicist Hossein Modarressi argues that the hadith of twelve successors must have been in circulation during the reign of the Umayyad caliph Hisham ibn Abd al-Malik ((r. 724 – 743)), long before the reported occultation (ghayba) of the twelfth and final Shia imam Muhammad al-Mahdi in 874 CE.

Identification with the caliphs
Some have argued that these twelve successors cannot be the first twelve caliphs after Muhammad because that list includes Yazid I ((r. 680 – 683)) who killed Husayn ibn Ali, the grandson of Muhammad, and assaulted Medina, a city held sacred in Islam. Alternatively, in his commentary on Sahih al-Bukhari, the Sunni theologian al-Qastallani suggests that this hadith may refer to twelve (non-consecutive) Muslim rulers, whose relatively stable reign was followed by the unstable rule of the Umayyad caliph al-Walid II ((r. 743 – 744)). Even though he does not name them, he is probably referring to the four Rashidun caliphs ((r. 632 – 661)), Mu'awiya I ((r. 661 – 680)) and his son Yazid I, Abd al-Malik ((r. 685 – 705)) and his four sons, and Umar II ((r. 717 – 720)). The second proposal of al-Qastallani is that the hadith may refer to twelve concurrent claimants to the caliphate who supposedly competed for power in the eleventh century. His third proposal is that the hadith may refer to the golden age of Islam that ended with the death of Umar II in 720. This means fourteen rulers, however, rather than twelve. So, al-Qastallani removes Mu'awiya II ((r. November 683 – June 684)) and Marwan I ((r. June 684 – April 685)), saying that their reigns were too short. He does, however, retain Hasan ibn Ali ((r. January 661 – August 661)). The Sunni jurist al-Nawawi interprets this hadith similarly in his commentary on Sahih Muslim. By contrast, with an anti-Umayyad attitude, the Sunni author al-Fadl ibn Ruzbihan (sixteenth century) identifies the twelve successors in the hadith as the "five" (rather than four) Rashidun caliphs, followed by Abd Allah ibn al-Zubayr, Umar II, and five unnamed Abbasid caliphs. Such interpretations have been criticized for the absence of a clear distinction between the proposed twelfth successor and the next caliph.

Before the occultation
Perhaps the earliest Shia versions of the hadith of twelve successors appear in Kitab Sulaym ibn Qays, attributed to Sulaym ibn Qays, who might have been a companion of Ali ibn Abi Talib, the first Shia imam. One version therein is related on the authority of Ali and some other Shia figures, including Abd Allah ibn Ja'far and Salman the Persian. According to this version, shortly before his death in 632, Muhammad told his companions at the Ghadir Khumm,

"Oh people, the legal power (al-wilaya) is granted only to Ali ibn Abi Talib and the trustees from my progeny, the descendants of my brother Ali. He will be the first, and his two sons, al-Hasan and al-Husayn, will succeed him consecutively. They will not separate themselves from the Quran until they return to God."

Until the late ninth century, however, such statements in Kitab Sulaym did not garner much attention among the Imamite Shias, the antecedents of the Twelver Shias. In particular, the hadith of twelve successors is absent from the works of the Imamite scholars of that time, including Muhammad ibn al-Haan al-Saffar, Sa'd ibn Abd Allah al-Ash'ari , and Ibn Qiba (died before 930). It was probably some decades after the occultation of their twelfth imam in 874 that the Imamites realized that their line of imams may not continue as before and identified their twelfth imam with the eschatological Mahdi. Only then the number of Shia imams became a central issue for the community.

After the occultation
The Shia traditionists al-Kulayni and Ibn Babawahy  were among the first who reported hadiths that set the number of Shia imams at twelve. In particular, al-Kulayni dedicates a chapter in his hadith collection Kitab al-Kafi to the number of imams. Sulaym's version of the hadith is also cited by the Shia authors al-Kulayni, al-Nu'mani (tenth century), and al-Tusi, while the Shia-leaning historian al-Mas'udi questions its authenticity. Another version of the hadith, cited by Ibn Babawahy on the authority of Ibn Abbas, youngest cousin of Muhammad, explicitly identifies the twelfth successor as the twelfth Shia imam, Muhammad al-Mahdi, who is often referred to as al-Qa'im (lit. 'he who will rise') in the Twelver hadith literature.

"I [Muhammad] am the master of the prophets and Ali is the master of my trustees, of whom there will be twelve; the first one is Ali, and the last is al-Qa'im."

Identification with the Twelve Imams
Noting that there have been many more (temporal) rulers after Muhammad, Twelver authors readily identify the twelve successors in this hadith with their Twelve Imams. For instance, the Twelver cleric Ja'far Sobhani argues that the dignity of Islam rests on these twelve successors, and this alone disqualifies the Umayyad and Abbasid caliphs, in his view. The last of these imams, Muhammad al-Mahdi, is believed to miraculously remain in occultation since 874, and is expected to return in the end of times to eradicate injustice and evil. Even beyond Twelver Shias, the belief in the eschatological figure of Mahdi is popular among all Muslims, possibly owing to numerous traditions to this effect in canonical Sunni and Shia sources. Mohammad Ali Shomali, a Shia scholar and an academic, links the occultation of the twelfth Shia imam to those Sunni versions of the hadith of twelve successors that imply the continuation of their reign until the end of times.

Zaydi sources
Variants of this hadith also appear in Zaydi Shia sources. The Zaydi scholar Abu Sa'id Abbad al-Asfari quotes Muhammad in his Kitab Akhbar al-Mahdi,

"I and eleven of my descendants and you, O Ali, are the axis of the earth, that is, its tent pegs and its mountains. By us, God has secured the world so that it will not sink with its people. For when the eleventh of my descendants has died the world shall sink with its people without warning."