|This article is part of a series on:|
In Islamic eschatology, the Mahdi (Arabic: مهدي / ISO 233: mahdī / English: Guided One) is the prophesied redeemer of Islam who will rule for seven, nine or nineteen years- (according to various interpretations) before the Day of Judgment (yawm al-qiyamah / literally, the Day of Resurrection) and will rid the world of wrongdoing, injustice and tyranny.
In Shia Islam, the belief in the Mahdi is a "central religious idea" and closely related as the Twelfth Imam, Muhammad al-Mahdi, whose return from occultation is deemed analogous with the coming of the Mahdi.
See Islamic eschatology.
 Mahdism in Sunni Islam
The Sunnis view the Mahdi as the successor of Prophet Mohammad, the Mahdi is expected to arrive to rule the world and he is to reestablish uprightness, harmony, and correct religion.
The definite term mahdi, means “the rightly-guided one”. The Mahdi is not mentioned in the Qurʾān, but rather in the Sunnah. Some hypothesise he came about when the Arabian tribes were settling in Syria under Mo’awiya. “They anticipated ‘the Mahdi who will lead the rising people of the Yemen back to their country’ in order to restore the glory of their lost Himyarite kingdom. It was believed that he would eventually conquer Constantinople.”
The Kaysāniya extented two other notions that became thoroughly related with the belief in the Mahdi. The first was the notion of return of the dead, particularly of the Imams. The second was the indication of occultation. “When Moḥammad b. al-Ḥanafiya died in 700, the Kaysāniya maintained that he was in occultation in the Raẓwā mountains west of Medina, and would one day return as the Mahdi and the Qāʾem.”
The appearance of the Prophet was also proposed unto the Mahdi. “An enormously influential tradition attributed to ʿAbd-Allāh b. Masʿud has Moḥammad predict the coming of a Mahdi coined in his own image: ‘His name will be my name, and his father’s name my father’s name’” 
 First school of thought
The mahdi is frequently mentioned in Sunni hadith as establishing the caliphate. Among Sunnis, some believe the Mahdi will be an ordinary man, born to an ordinary woman.
- Muhammad said:
The world will not come to an end until the Arabs are ruled by a man from my family whose name is the same as mine and whose father’s name is the same as my father’s.
- Umm Salama said:
His [the Mahdi's] aim is to establish a moral system from which all superstitious faiths have been eliminated. In the same way that students enter Islam, so unbelievers will come to believe.
When the Mahdi appears, God will cause such power of vision and hearing to be manifested in believers that the Mahdi will call to the whole world from where he is, with no postman involved, and they will hear and even see him.
I heard the Messenger of God say: "The Mahdi is of my lineage and family [...]".
- Abu Sa`id al-Khudri said:
The Messenger of God said: "He is one of us [...]"
The Messenger of God said: "The Mahdi is of my lineage, with a high forehead and a long, thin, curved nose. He will fill the earth with fairness and justice as it was filled with oppression and injustice, and he will rule for seven years.
The Messenger of God said: "At the end of the time of my ummah, the Mahdi will appear. God will grant him rain, the earth will bring forth its fruits, he will give a lot of money, cattle will increase and the ummah will become great. He will rule for seven or eight years.
A typical modernist in his views on the Mahdi, Abul Ala Maududi (1903–1979), the Pakistani Islamic revivalist, stated that the Mahdi will be a modern Islamic reformer/statesman, who will unite the Ummah and revolutionise the world according to the ideology of Islam, but will never claim to be the Mahdi, instead receiving posthumous recognition as such.
 Second school of thought
Javed Ahmad Ghamidi writes in his Mizan:
Besides these, the coming of the Mahdi and that of Jesus from the heavens are also regarded as signs of the Day of Judgment. I have not mentioned them. The reason is that the narratives of the coming of the Mahdi do not conform to the standards of hadith criticism set forth by the muhaddithun. Some of them are weak and some fabricated; no doubt, some narratives, which are acceptable with regard to their chain of narration, inform us of the coming of a generous caliph; (Muslim, No: 7318) however, if they are deeply deliberated upon, it becomes evident that the caliph they refer to is Umar ibn Abd al-Aziz who was the last caliph of the early history of the Muslims. This prediction of the Prophet has thus materialized in his personality, word for word. One need not wait for any other Mahdi now.