# Muhammad al-Mahdi

Part of a series on Shia Islam :
Twelver Shi'ism :
The Fourteen Infallibles
Muhammad
Fatimah
The Twelve Imams
Ali
Hasan
Husayn
al-Sajjad
al-Baqir
al-Sadiq
al-Kazim
ar-Rida
al-Taqi
al-Naqi
al-Askari
al-Mahdi :
Principles
Monotheism
Justice
Prophethood
Imamate
Judgement Day :
Other beliefs
Imamate of the Family
Angels
Mourning of Muharram
Intercession
Occultation
Wilayat al-Faqih
Usul al-fiqh
Ijtihad
Taqlid
Irfan :
Practices
Salat
Sawm
Hajj
Zakat
Khums
Jihad
Amr bi-l maʿrūf
Nahy ani l-Munkar
Tawalli
Tabarri :
Other practices
Mourning of Muharram
Arba'een Pilgrimage
Intercession :
Holy cities
Mecca
Medina
Najaf
Karbala
Mashhad
Jerusalem
Samarra
Kadhimiya
Qom :
Groups
Ja'fari
Usuli
Akhbari
Shaykhi :
Other related sects and groups
Alawites
Sufi orders and Alevism
Qizilbash
Safaviyya
Bektashism and folk religion
Malamatiyya
Qalandariyya
Hurufism
Bektashism
Galibi
Ni'matullāhī :
Scholarship
Law
Marja' (list)
Hawza
Ayatollah (list)
Allamah
Seghatoleslam
Hojatoleslam
Ijtihad :
Hadith collections
The Four Books
Kitab al-Kafi
Man La Yahduruhu al-Faqih
Tahdhib al-Ahkam
Al-Istibsar
Other hadith collections
Book of Sulaym ibn Qays
Bihar al-Anwar
Wasā'il al-Shīʿa
Reality of Certainty
Nahj al-Balagha
Mafatih al-Jinan
Al-Sahifa al-Sajjadiyya
Al-Amali :
Sources of ijtihad and jurisprudence
Qur'an
Hadiths of The Infallibles
Consensus
Reason :
Related topics
List of Twelver Shia books
Criticism of Twelver Shi'ism :
Shia Islam portal :
vte :
Muhammad ibn Hasan al-Mahdi (Arabic: محمد بن الحسن المهدي, romanized: Muḥammad ibn al-Ḥasan al-Mahdī) is believed by the Twelver Shia to be the last of the Twelve Imams and the eschatological Mahdi, who will emerge in the end of time to establish peace and justice and redeem Islam.
Hasan al-Askari, the eleventh Imam, died in 260 AH (873–874 CE), possibly poisoned by the Abbasids. Immediately after his death, his main representative, Uthman ibn Sa'id, claimed that the eleventh Imam had an infant son named Muhammad, who was kept hidden from the public out of fear of Abbasid persecution. Uthman also claimed to represent Muhammad, who had entered a state of occultation. Other local representatives of al-Askari largely supported these assertions, while the Shia community fragmented into several sects over al-Askari's succession. All these sects, however, are said to have disappeared after a few decades except the Twelvers, who accept the son of al-Askari as the twelfth and final Imam in occultation.
Uthman was followed by three more agents, collectively known as the Four Deputies, who were regarded by the Twelver community as representatives of Muhammad al-Mahdi. This period, later termed the Minor Occultation, ended after about seventy years with the death of the fourth agent, Abu al-Hasan Ali ibn Muhammad al-Samarri (d. 940–941). He is said to have received the final letter of Muhammad al-Mahdi shortly before his death. The letter predicted the death of Abu al-Hasan in six days and announced the beginning of the complete occultation, later called the Major Occultation, which continues to this day. The letter, ascribed to Muhammad al-Mahdi, added that the complete occultation would continue until God granted him permission to manifest himself again in a time when the earth would be filled with tyranny.
The Twelver theory of occultation crystallized in the first half of the fourth century AH (tenth century CE) based on rational and textual arguments. This theory, for instance, sets forth that the life of Muhammad al-Mahdi has been miraculously prolonged, arguing that the earth cannot be void of the Imam as the highest proof of God. In the absence of the Hidden Imam, the leadership vacuum in the Twelver community was gradually filled by faqīh "jurists". It is popularly held that the Hidden Imam occasionally appears to the pious. The accounts of these encounters are numerous and widespread among the Twelvers.

## Titles

Abu al-Qasim Muhammad ibn Hasan al-Askari, the eschatological savior in Twelver Islam, is known by many titles, including al-Mahdi (lit. 'the rightly guided'), al-Qa'im (lit. 'he who will rise'), al-Montazar (lit. 'the awaited'), Saheb al-Zaman (lit. 'lord of the age'), al-Gha'ib (lit. 'the hidden'), al-Hojja/Hojjat Allah (lit. 'the proof [of God]'), Sahib al-Amr (lit. 'lord of the cause'), Sahib al-Haqq (lit. 'lord of the truth'), Baqiyat Allah (lit. 'the remnant of God').
The title al-Qa'im signifies the rise against tyranny, though a wahid (lit. 'alone') hadith from the sixth Shia Imam, Ja'far al-Sadiq, connects this title to the rise of al-Qa'im after his death. As a wahid hadith, this report is not viewed as reliable by experts, writes the Shia Mohammad-Baqer Majlesi (d. 1699), especially because it contradicts the Twelver belief that the earth cannot be void of Imam at any time, as the hujjat Allah (lit. 'proof of God') on the earth. Majlesi also suggests that death might be meant figuratively in this hadith, referring to the forgotten memory of al-Qa'im after his long occultation.
Abdulaziz Sachedina notes that the titles al-Qa'im and Sahib al-Amr have more of a political emphasis than the eschatological title al-Mahdi. The title al-Hujja, on the other hand, highlights the religious function of the savior. Indeed, every Shia Imam is viewed as hujjat Allah, the (highest) proof of God, through whom the inner meanings of the Quran become accessible after the death of the prophet. This title is more pronounced for the twelfth Imam, however, possibly because of a related hadith from the tenth Imam, Ali al-Hadi.

## Historical background

Until their deaths, the tenth and eleventh Shia Imams (Ali al-Hadi and Hasan al-Askari, respectively) were held under close surveillance in the garrison town of Samarra by the Abbasids, who are often responsible in Shia sources for poisoning the two Imams. The two Imams witnessed the deterioration of the Abbasid caliphate, as the imperial authority rapidly transitioned into the hands of the Turks, particularly after al-Mutawakkil (March 822 – 11 December 861 CE).
Contemporary to the tenth Imam, Caliph al-Mutawakkil violently prosecuted the Shia, partly due to the renewed Zaydi opposition. The restrictive policies of al-Mutawakkil towards the tenth Imam were later adopted by his son, al-Mu'tamid, who is reported to have kept the eleventh Imam under house arrest without any visitors. Instead, al-Askari is known to have mainly communicated with his followers through a network of representatives. Among them was Uthman ibn Sa'id al-Asadi, who is said to have disguised himself as a seller of cooking fat to avoid the Abbasid agents, hence his nickname al-Samman.
Muhammad Husayn Tabatabai suggests that these restrictions were placed on al-Askari because the caliphate had come to know about traditions among the Shia elite, predicting that the eleventh Imam would father the eschatological Mahdi.

## Succession to al-Askari

Hasan al-Askari died in 260 (873–874) without an obvious heir. The death of the eleventh Imam divided his followers into several sects and created widespread confusion (hayra), particularly in Iraq. Immediately after the death of al-Askari, his main agent, Uthman ibn Sa'id, claimed that the Imam had an infant son, named Muhammad, who was kept hidden from the public out of fear of Abbasid persecution. As the closest associate of al-Askari, this assertion by Uthman was largely supported by other representatives of al-Askari. Those who accepted the imamate of this Muhammad later formed the Twelvers.
Some others held that the imamate ceased with al-Askari and the Waqifites maintained that the eleventh Imam would later reemerge as the eschatological Mahdi. Others concluded that Muhammad ibn Ali al-Hadi, a deceased brother of al-Askari, must have been the true Imam. Yet others accepted the imamate of Ja'far al-Zaki, another brother of al-Askari. Some believed that the twelfth Imam would be born in the end of time to a descendant of al-Askari, and some left the Shia community.
All these sects, however, are said to have disappeared within a hundred years except the group that went on to become the Twelver Shia.

## Birth and early life of al-Mahdi

When al-Askari died without leaving an obvious heir, the traditions and predictions attributed to earlier Imams were largely the basis for the existence of the son of al-Askari as the twelfth Imam; see Twelver doctrine of occultation.
As for the details of his birth, Twelver sources report that the son of al-Askari was born around 255 (868). He was named Abu al-Qasim Muhammad, the same name and kunya as the Islamic prophet, though he is more commonly known as Muhammad al-Mahdi (lit. 'the rightly guided'). His birthdate is given differently, but most sources seem to agree on 15 Sha'ban, which is celebrated by the Shia for this occasion. The Twelver accounts describe that, except for a few trusted associates, the existence of al-Mahdi was kept secret since the Abbasids sought to eliminate the son of al-Askari, whom persistent rumors described as a savior. Hussain writes that the infant must have been sent to Medina, where al-Askari's mother lived.
The birth of al-Mahdi is often compared in Twelver sources to the birth of Moses in the Quran, who was miraculously saved from the pharaoh. As a child Imam, al-Mahdi is also often compared to Jesus, since both are viewed as the proof of God (hujja) and both spoke with the authority of an adult while still a child.
Al-Mahdi is said to have been born to Narjis, a slave-girl whose name is given by various sources as Sawsan, Rayhana, Sayqal, and Maryam. The first three are names of flowers and were likely given to her by her owner in keeping with the practice of the day. Her origin is recorded as the Byzantine Empire or Nubia, and some accounts state that she was bought providentially by an agent of al-Hadi, who recognized by clairvoyance in her the future mother of al-Mahdi. In the same vein, the detailed accounts of Mohammad-Baqer Majlesi and Shaykh Tusi describe Narjis as a captured granddaughter of the Byzantine emperor and a pious woman who learned about her future union with al-Askari in a dream, though these accounts have been described as hagiographic. Possibly the correct account is given by al-Mufid, who writes that Narjis was a slave girl born and raised in the house of Hakima Khatun, daughter of Muhammad al-Jawad (the ninth Imam) and paternal aunt of al-Askari.

### Abbasid reaction

The death of al-Askari in 260 (873–874) followed a brief illness, during which the Abbasid al-Mu'tamid sent his doctors and servants to attend the Imam. Considering that al-Askari did not have an obvious heir, it has been suggested that the caliph intended to closely monitor al-Askari from within his residence. After the death of al-Askari, there are reports that his residence was searched and the women were examined for pregnancy, possibly in the hope of finding his heir. A female servant of al-Askari was held for a while, perhaps due to false rumors of her pregnancy designed to distract the Abbasids in their search.
Al-Askari left his estate to his mother, Hadith, to the exclusion of his brother, Ja'far ibn Ali al-Hadi, who had earlier unsuccessfully laid a claim to the imamate after the death of their father, al-Hadi. Ja'far repeated his claims to the imamate after the death of al-Askari, which this time found a following in the form of the now-extinct Ja'fariyya and Fathiyya sects. He also contested al-Askari's will and raised the case with the authorities. Al-Askari was apparently childless, and Hadith was thus regarded as the sole inheritor in Shia law. The caliph, however, ruled the inheritance to be divided between Hadith and Ja'far.

## Minor Occultation (874–941)

Immediately after the death of al-Askari in 260 (873–874), Uthman ibn Sa'id al-Asadi (d. 880) claimed that al-Askari had a young son, named Muhammad, who had entered a state of occultation (ghayba) due to the Abbasid threat to his life. As the special representative of al-Askari, Uthman also claimed that he had been appointed to represent the son of the eleventh Imam. A Shia tradition attributed to the sixth Imam, Ja'far al-Sadiq, states that this threat was specific to Muhammad al-Mahdi, who was expected to rise, unlike his predecessors who practiced religious dissimulation (taqiya) and were politically quiescent.
Twelver sources detail that al-Mahdi made his only public appearance to lead the funeral prayer for his father instead of his uncle, Ja'far al-Zaki. It is also said that the occultation took place in the family home in Samarra, where currently a mosque stands, under which there is a cellar (sardab) that hides a well (Bi'r al-Ghayba, lit. 'well of the occultation'). Into this well, al-Mahdi is said to have disappeared.
In his new capacity as the caretaker of the office of imamate, Uthman received petitions and made available their responses, sometimes in writing. As the closest associate of al-Askari, most of al-Askari's local representatives continued to support Uthman. However, there might have been doubts among the Shia about his authority to collect and manage the religious funds.
Uthman later introduced his son, Abu Jafar Muhammad ibn Uthman (d. 916–917), as the next representative of al-Mahdi. Abu Ja'far, who served for some forty years, has been credited with the unification of the mainstream Shia behind the son of al-Askari as the twelfth Imam in concealment. In turn, as his replacement, Abu Ja'far nominated Abu al-Qasim al-Husayn ibn Ruh al-Nawbakhti (d. 937-38), who is said to have been a well-respected figure in the Abbasid court. Under Abu al-Qasim, it is reported that the communications with the Hidden Imam resumed after a lapse of about twenty-five years.
This period, later termed the Minor Occultation (al-ghaybat al-sughra), ended after about seventy years with the death of the fourth agent, Abu al-Hasan Ali ibn Muhammad al-Samarri (d. 940-41), who is said to have received a letter from al-Mahdi shortly before his death. The letter predicted the death of Abu al-Hasan in six days and announced the beginning of the complete (tamma) occultation, later called the Major Occultation (al-ghaybat al-kubra). The letter, ascribed to al-Mahdi, added that the complete occultation would continue until God granted him permission to manifest himself again in a time when the earth would be filled with tyranny. The letter emphasized that anyone claiming to be the deputy of the Imam henceforth had to be considered an imposter. This and similar letters to the four agents and other Shia figures are said to have had the same handwriting, suggesting that they were written by the Hidden Imam.

### Shia authority

The number of these agents was not limited to four in early Shia sources. Sachedina suggests that the later stress of the Twelver literature on the Four Deputies (al-nuwwab al-arba') was likely due to their prominence in Baghdad, the Shia center of the time. Similarly, Moojan Momen reckons that al-Askari's network of the representatives (wukala) likely continued to operate during the Minor Occultation of al-Mahdi. Indeed, ibn Babawayh (d. 991) speaks of other trusted men of the Hidden Imam in different cities in addition to the four agents. Sachedina writes that the Shia community lacked a notable figure to replace the fourth agent after his death.
The authority of the four agents on behalf of the Hidden Imam was challenged by some Shia figures, more so during the term of the third agent, al-Nawbakhti. For instance, Abu Ja'far Muhammad ibn Ali al-Shalmaghani turned against al-Nawbakhti and claimed to be the rightful agent of al-Mahdi, before denouncing the concept of occultation as a lie. Another instance was a disciple of al-Askari, named al-Karkhi, who was later condemned in a rescript, said to be written by al-Mahdi. Some miracles are also ascribed to the four agents, perceived by the faithful to be the result of their initiation by the Hidden Imam.

### Shia community

At the time, the occultation of al-Mahdi was likely not a radical change for his followers. Indeed, the tenth and eleventh Imams were already effectively in occultation for the majority of the Shia, as both Imams were held nearly isolated in Samarra by the Abbasid caliphs. It also appears that the idea of occultation was a well-established concept for the Shia and the related traditions were already in circulation among them. These traditions forecasted the occultation and rise of a future Imam, referred to as al-Qa'im (lit. 'he who will rise') and less frequently as al-Mahdi. These traditions were appropriated by various Shia sects in different periods. For instance, they were used by the Waqifites to argue that Musa al-Kazim, the seventh Imam, had not died but was in occultation. Even earlier, the now-extinct Kaysanites denied the death of Muhammad ibn al-Hanafiyya and awaited his return.
The political situation of the Shia in Iraq improved after the rise of the Buyid dynasty in the fourth (tenth) century. Perhaps it was the relative safety of the Shia that prompted the second agent to issue a rescript to the effect that al-Mahdi remained in occultation to avoid the burden of commitment (bay'a) to unjust rulers of the time who were the usurpers of the Imam's right in the Shia view. Ibn Babawayh (d. 991) suggested that the situation remains unknown until the reappearance of Muhammad al-Mahdi but also added that the large population of the Shia did not necessarily guarantee his safety.
Nevertheless, many did not expect the occultation to continue beyond six years or beyond the fortieth birthday of al-Mahdi, and this might have contributed to an atmosphere of doubt and uncertainty among the Shia. According to Hossein Modarressi, these doubts gradually disappeared from the Shia community, possibly due to the efforts of the Shia traditionists during the period of transition to the Major Occultation. These traditionists heavily relied on prophetic traditions and specific interpretations of the Quran to vindicate the imamate of al-Mahdi. In this period, possibly after 295 (908), Shia traditionists also settled the number of Imams with the help of a Sunni hadith, in circulation long before the occultation, which stated that the prophet would be followed by twelve successors. The Hidden Imam was thus also the last Imam.

## Major Occultation (941–present)

The Major Occultation, a term coined later, began with the death of the fourth agent in 329 (940–941), who did not designate a successor. In this period, which continues today, there is no agent of the Hidden Imam on earth. There is some evidence that the death of the fourth agent also dissolved the underground network of representatives responsible primarily for the collection and distribution of the religious dues. The office of deputyship was thus formally closed. Despite some uncertainty, there were likely early traditions among the Shia that had already predicted the two periods of occultation. These hadiths were previously cited, for instance, by the Waqifites in reference to the two arrests of Musa al-Kazim, the seventh Imam. Nevertheless, the prolonged absence of the Hidden Imam seems to have created widespread doubts among his followers.

### Leadership vacuum

As both the spiritual and political head of the Shia community, the occultation of the Hidden Imam left a considerable gap in the Shia community. This leadership vacuum was eventually filled by Twelver jurists (fuqaha), who remain the sole leaders of the Shia community during the Major Occultation. Often cited to support this transition is a letter received by Ishaq ibn Ya'qub in response to his religious inquiries of the second agent. The letter, said to be written by al-Mahdi, stipulated that
   As for the events which may occur [in future when you may need guidance in religious matters] refer to the transmitters (ruwat) of our sayings (hadith) who are my hujja (lit. 'proof') to you and I am the hujja of God to you all [or "to them" in another version].
A few similar hadiths are attributed to the tenth and eleventh Imams. The traditions also specify that these jurists must be just and knowledgeable in Islamic law. As the absence of the Hidden Imam continued, however, the Twelver jurists evolved from mere transmitters (ruwat) of hadith to mujtahidun in order to resolve new religious questions that arose over time. Their authority also increased with time to address the need to explicate religious teachings for the community. For instance, as early as the seventh (thirteenth) century, Muhaqqiq al-Hilli (d. 1277) spent the Imam's share of Khums (a type of Islamic alms) on activities that furthered the cause of Shia, as opposed to his predecessors, such as al-Shaykh al-Mufid (d. 1022), who often asked the faithful to save these donations for the rise of al-Mahdi.
Considering that jurists were not directly appointed by the Hidden Imam, it was debated whether their authority should extend to functions with political implications, such as declaring holy war (jihad). It was likely Zayn al-Din al-Juba'i al'Amili (d. 1558) who first suggested that a (qualified) jurist was the general deputy (na'ib al-amm) of the Hidden Imam whose authority encompassed all prerogatives of the Imam. The transition of Twelver jurists into their new role was facilitated by the formation of Shia states, particularly the Safavid and Qajar dynasties in Iran. For instance, during the Russo-Iranian war of 1804–1813, the eminent clerics of Najaf and Isfahan issued a declaration of jihad against the Russians to support the Qajarite Abbas Mirza, who was conducting the campaign. Later on, however, jurists often had to compete with the Shia monarchs for religious authority.
In sum, the politically quiescent approach of the Twelver jurists over time gave way to eventually questioning the legitimacy of Shia monarchs and even attempts to restrict their power through a constitution. This evolution culminated with the concept of wilayat al-faqih (lit. 'guardianship of the jurist') by Ruhollah Khomeini, the religious leader of the Iranian Revolution in 1979, who called upon religious scholars to assume an active role after the toppling of Mohammad Reza Pahlavi, the last monarch of Iran.

### Doctrinal developments

While some traditions, dating back to before 260 (874), might have predicted a second occultation, the sources from the beginning of Major Occultation indicate that the prolonged absence of the Hidden Imam may have led many of the Twelvers to abandon their belief in him. His absence also provided a basis for renewed criticisms at the time, voiced by the Mu'tazilites and Ash'arites. These pressures likely expedited a transition in Twelver arguments from a traditionist to a rationalist approach in order to vindicate the occultation of al-Mahdi. Abu Sahl Isma'il ibn Ali al-Nawbakhti (d. 923), for instance, argued that the absence of an Imam does not invalidate his religion or law, as with the absence of a prophet. Concerns about inauthentic hadiths, voiced by Tusi (d. 995) and others, might have given another impetus to this transition.
Starting with ibn Babawayh (d. 991) and his student al-Shaykh al-Mufid (d. 1022), Shia scholars began to employ theological arguments modeled on the Mu'tazilite kalam. Of these, the principle of al-lutf (lit. 'kindness') is an example which, at a high level, necessitates that a prophet or an Imam should exist at any time to guide towards God, as the manifestation of His utmost kindness towards His subjects. Other Twelver arguments aim to establish that the Hidden Imam benefits the humankind even in occultation, "just as the people benefit from the sun while it is covered by clouds." While the ordinary Twelvers were likely content with the traditions about occultation, the theologist approach to vindicating the Hidden Imam was intended to address the criticisms of the non-Twelver theologians. The two approaches were blended together by Shaykh Tusi in his substantial monograph Kitab al-Ghayba (lit. 'book of occultation').

### Visitations

The Twelvers believe that the primordial Nūr "Light" of the prophethood has continued to shine through the ages in the character of the Imams. Thus the Hidden Imam is not viewed as inaccessible in the state of occultation. Indeed, it is popularly held that al-Mahdi occasionally appears to the pious in person or, more commonly, in dreams and visions. The accounts of these encounters are numerous and widespread in the Twelver community. Among these accounts are also the encounters of the prominent religious scholars (ulama) with the Hidden Imam.
The descriptions of these contacts often show the concern of the Hidden Imam for the well-being of his followers and how such encounters may prompt the believer's "spiritual resurrection," an interpretation put forward by late mystic sources. As the Hidden Imam can only be seen in the end of time, those who see him, it is argued, have attained their end of time. For instance, publishers close to the Lebanese Shia militant organization Hezbollah have published the accounts of some Hezbollah fighters who believed they were directly assisted by al-Mahdi in critical moments on the battlefields of the 2006 Lebanon War.

## Twelver doctrine of occultation

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 (khalifas), 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, Fatimah, 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 (umma) 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 (d. 1067) 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, Sobhani writes, 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 (bay'a) 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 (este'jal) and setting time (tawqit) 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 (sayha, neda) 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 (kasf) 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 (al-nafs al-zakiya).

## Connections with the Islamic figure of Mahdi

A widely-held Muslim belief is that a restorer of religion and justice, with the name of Mahdi (lit. 'rightly guided'), will rule the world in the end of time. In particular, it appears to be an accepted notion in Sunni Islam that this savior would be a descendant of the Islamic prophet Muhammad through his daughter Fatimah and his son-in-law Ali. While absent from the Sahihs of Muhammad al-Bukhari and Muslim ibn al-Hajjaj, traditions about Mahdi can be found in other canonical Sunni hadith collections, including the works of Abu Dawud al-Sijistani, al-Tirmidhi, ibn Majah, and al-Nasa'i, and Ahmad ibn Hanbal. These hadiths have likely strengthened the popular belief in Mahdi among Muslims. Historically, various Muslim figures were identified with Mahdi or used the name as an honorific epithet with messianic significance. These include the Umayyad Umar II and the Abbasid al-Mahdi, among many others.
Unlike Sunni Islam, however, the belief in Mahdi of the lineage of the prophet is central to Shia Islam, in general, and to Twelver Shia, in particular, where Mahdi is identified with the twelfth Imam. Distinctive to Shia is also the doctrine of occultation or the temporary absence of Mahdi. Sunni and Shia traditions, however, have much in common about the career of Mahdi. In particular, Moojan Momen lists several signs before the advent of Mahdi which are common to both Sunni and Shia beliefs.

### Support from Sunni circles

As early as the fourth (ninth) century, or possibly much earlier, Shia sources identify the twelfth Imam with the messianic figure of Mahdi in Islam. The Twelver authors also aim to establish that the description of Mahdi in Sunni sources applies to the twelfth Imam. Their efforts gained considerable momentum in the seventh (thirteenth) century when several notable Sunni scholars endorsed the Shia view of Mahdi. For instance, in his Kitab al-Bayan fi akhbar sahib al-zaman, the Shafi'i traditionist Muhammad ibn Yusuf al-Gandji proved that the twelfth Shia Imam was Mahdi, relying solely on Sunni traditions. Since then, Amir-Moezzi writes, there is Sunni support from time to time for the Twelvers' view of Mahdi.
Wilferd Madelung writes that a major Sunni objection to the Mahdiship of the twelfth Imam, whose name and kunya matches those of the prophet, is that the name of his father, Hasan al-Askari, differs from the prophet's father, Abdullah ibn Abd al-Muttalib. On the other hand, according to Madelung, al-Aburi testified that this stipulation was later added to the tradition by the Kufan transmitter Za'ida (d. 777-8).

### Support from Sufi circles

There has also been some Sufi support for the Mahdiship of the twelfth Imam. Al-Bayhaqi (d. 1066) writes that some Sufi gnostics agreed with the Twelvers about the identity and occultation of Mahdi. As another instance, the Egyptian Sufi al-Sha'rani, not known to be sympathetic to the Shia cause, echoed the Twelver views about Mahdi in his al-Yawaqit wa al-Jawahir. Possibly to avoid the Shia implications of this statement, al-Idwi later falsely quoted parts of it and suppressed the rest.

## Birthday celebration

The birthday of Muhammad al-Mahdi is celebrated annually in Iran on 15 Sha'ban. On the evening of the birthday, millions of people in the country celebrate the occasion annually. The city of Qom is decorated by bright lights and flags. The date of the celebration is based on the Islamic calendar and changes from year to year:
| Islamic year | Iran |
| 1440 | 21 April 2019 |
| 1441 | 9 April 2020 |
| 1442 | 29 March 2021 |
| 1443 | 19 March 2022 |
| 1444 | 8 March 2023 |
| 1445 | 25 February 2024 |
| 1446 | 14 February 2025 |