Shi’as have confined their loyalty to the twelve Imams from Ahlul Bayt, peace be upon them, the first of whom is Ali ibn Abu Talib followed by his son al-Hasan then his son al-Husayn then the nine infallible ones among al-Husayn's offspring, peace and blessings of Allah be upon all of them. The Messenger of Allah had named all these Imams in many of his statements either explicitly or implicitly, and he had mentioned them by name according to some traditions transmitted by the Shi’as and others transmitted by “Sunni” scholars.
Some of Ahlul Sunnah may object to these traditions, expressing astonishment at how the Messenger could have talked about issues related to the unknown which were enshrouded with non-existence. The Holy Qur’an states: “Had I known the unseen, I would have had much of good and no evil would have touched me” (Holy Qur’an, 7:188). To counter this argument, we say that this sacred verse does not exclude the Messenger from knowing the unseen at all; rather, it was revealed in response to some polytheists who asked him to inform them when the Hour would come, and the time of the Hour is the sole knowledge of Allah, Glory to Him, which He shares with nobody.
The Holy Qur’an, on the other hand, clearly states: “The One Who knows the unseen! So He does not reveal His secrets to anyone except to whomsoever He chooses (such) as an apostle” (Holy Qur’an, 72:26-27). The exception to which this verse refers indicates that He, Glory to Him, acquaints His messengers whom He chooses with the knowledge of the unseen. For example, read what Joseph (Yusuf), peace be upon him, said to his prison inmates:
“No food shall come to you except that I will inform you of it before it reaches you; surely this is of what my Lord has taught me” (Holy Qur’an, 12:37). Another example is this verse: “Then they found one of Our servants whom We had granted mercy and whom We had taught knowledge from Us” (Holy Qur’an, 18:65). This is a reference to the story of al-Khidr who met Moses and whom he taught of the knowledge of the unseen, the knowledge which he could not wait to know in time. Muslims, be they Shi’as or Sunnis, did not dispute the fact that the Messenger of Allah used to know the unseen, and many incidents have been recorded in this regard such as his statement to Ammar: “O Ammar! The oppressive party shall kill you,” and his statement to Ali: “The worst wretch among the generations to come is a man who will strike you (with the sword) on your head, so he will drench your beard (with your blood).”
He had also said to Ali, “My son al-Hasan will be the one through whom Allah will bring peace between two large parties.” Another is his statement to Abu Dharr al-Ghifari in which he told him that he would die alone in banishment, and the list of such numerous incidents goes on and on. Among them is the famous tradition which al-Bukhari and Muslim and all those who succeeded them states: “The Imams after me are twelve: all of them will belong to Quraysh,” and according to another narration, “all of them will be the offspring of Hashim.” In both our previous books To be with the Truthful [Ma`a alSadiqin] and Ask Those Who Know [Fas'aloo Ahlul Dhikr], we proved that Sunni scholars themselves have referred in their Sahih and Musnad books to the traditions relevant to the Imamate of the Twelve Imams, admitting their authenticity.