The Twelver doctrine of occultation crystallized in the first half of the fourth (tenth) century. In its simplest form, this doctrine states that Muhammad al-Mahdi, the twelfth Imam, did not die but has been concealed by God from humanity. His life has been miraculously prolonged until the day he manifests himself again by God's permission to fill the earth with justice. This occultation continues until the safety of the Imam can be guaranteed, and until humankind is ready to receive his guidance. During the Minor Occultation, he remained in contact with his followers through the four
Babs (gates). During the Major Occultation, which began in 329 (941) and continues to this day, there is no direct communication, though the Hidden Imam still remains responsible in Twelver belief for the inward spiritual guidance of humankind (whereas his outward role begins with his reappearance).
Hadith literature The Twelver literature about the doctrine of occultation is extensive, based on rational and textual arguments. One such instance is a prophetic hadith, reported by Shia and Sunni authorities, including the canonical
Musnad Ahmad ibn Hanbal. One version of this hadith reads, "If the earth had only one day of existence left to it, God would prolong that day until a man of my posterity, whose name will be my name, and his surname my surname, manifests himself; he will fill the earth, filled till then with violence and oppression, with harmony and justice." Another prophetic hadith, in circulation long before the occultation, predicted that Muhammad was to be followed by twelve successors (s), during whose reign the Islamic community would be united, as reported in
Sahih Muslim and other canonical Sunni sources. It is argued that these twelve successors cannot include the (often immoral) Umayyad or Abbasid caliphs and, in any case, their number exceeded twelve. These twelve, he thus concludes, are the
Twelve Imams. More generally, in Twelver collections of hadith, the reappearance of al-Mahdi is the most frequently cited subject in predictions made by the prophet, his daughter,
Fatima, and the Twelve Imams.
Quran Al-Mahdi is viewed by the Twelvers as a hidden saint in view of verses 18:65–66 of the Quran and the two types of saints in those verses, namely, outwardly manifest, such as Moses, and hidden, like
Khidr. As with the account of Khidr in the Quran, it is held that the Hidden Imam benefits the Islamic community () during the occultation, as the sun behind clouds still gives light and warmth.
Muhammad al-Baqir, the fifth Imam, is said to have related verse 21:105 of the Quran to the rise of al-Mahdi: "And verily We have written in the scripture (
Zabur), after the reminder, [that] My righteous slaves will inherit the earth." As another instance, Shaykh Tusi () connects verses 28:5–6 to the rule of al-Mahdi in the end of time. In particular, verse 28:5 reads, "And We desired to show favor unto those who were oppressed in the earth, and to make them Imams and to make them the inheritors."
Reasons for occultation While the Abbasid threat might have initially forced al-Mahdi into occultation, his absence continues in Twelver belief until initial conditions are met for his reappearance to establish justice and peace on earth. One such condition, according to
Ja'far Sobhani, is humankind's readiness for the intellectual and spiritual message of the Hidden Imam. Without these conditions, he argues that al-Mahdi might be killed similar to his predecessors. Similarly, when asked about the reason for the occultation,
Muhammad al-Baqir is reported to have answered, "To prevent his being killed." Shia traditions add two more reasons for the occultation, namely, test for the followers of the Imam and their faith, and avoiding the burden of commitment () to unjust rulers of the time. It is also held that the true reason for the occultation will be only known when the Imam reappears as in the story of Musa and Khidr, where the motivation of Khidr for his actions was not immediately revealed to Musa.
Longevity In response to Sunni criticism and even ridicule, Shia scholars have argued that the longevity of the Hidden Imam, born around 868 CE, is not unreasonable given the long lives of
Khidr,
Jesus, and the
Dajjal (another eschatological figure), as well as secular reports about long-lived men. Along these lines,
Muhammad Husayn Tabatabai emphasizes the miraculous qualities of al-Mahdi, adding that his long life, while unlikely, is not impossible.
Reappearance Shortly before the
Last Judgment, when commanded by God, al-Mahdi will return to lead the forces of righteousness against the forces of evil in an apocalyptic war that would ultimately establish peace and justice on earth, according to the Twelvers. He is also viewed by the Twelvers as the restorer of true Islam. In his mission, al-Mahdi will be assisted by
Jesus, who will kill the Dajjal or "antichrist" in some Islamic accounts. Al-Mahdi would also be accompanied by 313 loyal followers, their number identical to the number of Muslim warriors in the
Battle of Badr. He is expected to reemerge as a young man in possession of the relics of the past prophets, e.g., the staff and arc of Moses. The time of his reappearance is unknown, however, and Shia hadiths expressly forbid haste () and setting time () for his return. Numerous Shia hadiths predict that the reappearance of al-Mahdi would be heralded by some signs, of which some are inevitable, and others are conditional, i.e., might change by divine decision. Alternatively, some of these signs are general, and some are specific. The foremost general sign of the second coming of al-Mahdi is the prevalence of evil on earth in the form of tyranny, injustice, and religious and moral degradation. In particular, at the time, Islam would be devoid of its soul and practiced only outwardly. Only a fraction of the Shia, those who truly practice their Imams' teachings, will remain on the righteous path in the end of time. Among the special signs are the rise of
Sufyani, who would later command the enemies of al-Mahdi, the rise of Yamani, who would later support al-Mahdi, the divine cry (, ) which calls upon men to join al-Mahdi, often followed shortly by another supernatural cry from the earth that invites men to join the enemies of al-Mahdi, the swallowing up () of an army dispatched by Sufyani in a desert, and the assassination by
Meccans of the messenger of al-Mahdi, referred to as the pure soul (). == Connections with the Islamic figure of Mahdi ==