The hadith of the twelve successors, or twelve caliphs is an Islamic prophecy, attributed to Muhammad. It is most popular among Twelver Shi'ites, as they interpret the prophecy was fulfilled by the Twelve Imams. The hadith is widely accepted by all Muslims, but its interpretation varies heavily.
Sunni view
According to the prophecy there will reign twelve caliphs—presumably the first being crowned upon Muhammad's death—and after which the caliphate would cease to exist and mark the beginning of the judgement day or armageddon. It is stated that all twelve caliphs will be from the tribe of Quraysh. Interpretation of the hadith varies widely among Sunni scholars; some have openly claimed that they do not know the meaning. Another interpretation is that the prophecy was fulfilled by the Rashidun Caliphs. Some commentators, such as Ibn Kathir and Ibn Taymiyya, link this hadith with the biblical account of Moses and his twelve deputies.
Imam Muslim on Sahih Muslim wrote: Rasulullah s.a.w said: "This religion will remain standing until twelve caliphs, which all of them is from Quraysh, rule over you."
Imam Abu Dawud on Shahih Abi Dawud wrote: Masyruq said: We were sitting with Abdullah bin Mas'ud to learn the Qur'an from him. Someone asked him: Did you ask the Messenger of Allah s.a.w how many caliphs will rule this Ummah ? Ibnu Mas'ud answered: Of course we asked this thing from Rasulullah s.a.w and he answered: "Twelve, like the amount of the leaders of Banu Isra'il."
Shia Muslimsbelieve in the concept of Imamah, while rejecting the Sunni view of Caliphate and the four khalifs namely: Abu Bakr, Umar, Uthman and Ali. According to Twelver Shias, there is no tradition or proof which states that the number of leaders will be anything other than twelve. The twelve successors from the hadith are already known as the Twelve Imams. Two hadiths form the basis and understanding of the 12 successors of Muhammad: the Hadith ath-thaqalain, and the hadiths regarding the 12 khalifs. One of the most authentic hadith is the Hadith ath-thaqalain in which Muhammad tells the Muslims that he is leaving behind thaqalayn, the Quran and his bayt. Al-Tirmidhi in his Sunan records the following tradition: This tradition was recorded by many other sources Muhammad also repeated this hadith at a place called Ghadir Khumm. Al-Nasa'i records the following tradition: Among others who have recorded it in their books are Al-Bukhari in his tarikh, Muslim in his sahih, the musnad of ahmad bin hanbal, sunan of abu dawud, and al tabarani: These hadiths indicate that Muhammad left the Muslim Ummah to the leadership of his progeny or household and established the first of these 12 imams / khalifs as his cousin and son-in-law, Ali ibn Abu Talib. Having established the importance of following the teachings of his bayt as the guides for the understanding of the Quran for members of his community, Muhammad also informed his companions that the number of leaders / Imams / Khalifs after him will specifically be twelve in number. The following references are taken from the "sahih" books of Sunni Muslims: The conclusion of the Twelver Shia school is that Muhammad left the world with the Quran and his bayt as guides for humanity. Similar to the 12 tribes of bani Israel and the 12 disciples of Jesus, Muhammad also left his community with 12 heirs to guide the community and protect the interpretation of the Quran. Of note, very few of God's chosen messengers and guides ever attained worldly power. As such, the concept of the twelve successors is not a prophecy of worldly leaders, but rather spiritual guides and the notion that these twelve must be worldly leaders to be successors of Muhammad is rejected. These twelve imams are not a monarchy, but rather are spiritual leaders in the line of Abraham as promised to him in the Quran 2:124: "And when his Lord tried Ibrahim with commands, he fulfilled them. He said: Surely I will make you an Imam for mankind. said: And of my offspring ? He said, my covenant does not include the unjust."