Arabic mahdī, literally, one rightly guided
The Mahdi, meaning "the guided one," is the honorary title of the expected deliverer or messianic figure in Islam. Although the term and concept is not found in the Qur˒an, both Sunni and [Shi˓a hadith collections mention it among the prophetic traditions concerning crises (fitan). These traditions often contain [eschatological material, and frequently speak of a figure who will come at the end of time to combat the forces of evil led by the one-eyed Dajjal. This righteous individual is said to be one who "will fill the earth with justice after it has been filled with injustice and tyranny." The Mahdi's coming will lead the forces of good in a final apocalyptic battle, where the good will triumph. Jesus will also return to earth at this time, according to some reports, and fight alongside the Mahdi or rule after him. All of these events are predicted to take place shortly before Judgment Day.
In Twelver Shi˓ite Islam, due to the community's minority status and continuing sense of persecution and injustice, the Mahdi symbol developed into a powerful and central religious idea and became combined with the figure of the last of the twelve Imams, Muhammad al-Mahdi, who is believed to have disappeared around 874. He was born in Samarra, son of Hasan al-Askari and the lady Nargis. He is also known as the ruler of the time (sahib al-zaman), the one who will restore justice (qa˒im), and the awaited one (al-muntazar).
Lists of the qualities of the expected one were drawn up, including his name being Muhammad, his descent from the Prophet, his appearance (zuhur) or rising, his rule (for either seven, nine, or nineteen years), and his mission to restore justice on earth. After the last imam disappeared as a child, Shi ite sources identified a lesser occultation (disappearance) of some seventy years, during which a series of four deputies was said to have consulted with him. After that time, the Mahdi, or Hidden Imam, entered the greater occultation that is still in force, remaining alive but not meeting with representatives. The fact that Shi˓ite religious scholars are believed to continue to receive his blessings and guidance gives them a greater charisma and authority than their Sunni counterparts. Shi˓ite political theory traditionally declared all temporal power illegitimate in the absence of the imam, only recently allowing the concept of a caretaker government of religious authorities (wilayat al-faqih) that underlies today's Islamic republic in Iran.
Claimants to the role of the Mahdi have not been absent from Islamic history. The first was Muhammad al-Hanifiyya (d. 700), son of ˓Ali from a wife other than Fatima, whose role as the Mahdi was promoted by al-Mukhtar (d. 687). Although al-Mukhtar was killed and his movement crushed, ideas that Muhammad al-Hanafiyya did not die and would one day return continued to circulate and later attached themselves to subsequent imams. More recent claimants have arisen in both Shi˓a and Sunni contexts, including Muhammad Mahdi of Jaunpur in India (d. 1504), whose followers continue as a separate Muslim sect, the Mahdavis, and the Sudanese Mahdi, Muhammad Ahmad (d. 1885), who rose against the British occupiers and was killed at the battle of Omdurman. Contemporary Islamist or Sufi movements may occasionally evoke the anticipated return of the Mahdi as a means of encouraging millenarian expectations among their followers. In Shi˓a Islam, expectation and eager anticipation of the Mahdi's return is a central theme of piety and discourse.