Who is the Mahdi in Islam?

The Mahdi ("the rightly guided one") is a righteous leader from the Prophet's family who, according to hadith, will appear near the end of time and fill the earth with justice. Most Sunni Muslims believe he is still to be born. Believing in him is part of believing the Prophet's ﷺ news about the future, but no one should follow a person just because he claims the title.
What the hadith say about him
The Mahdi is not named in the Quran. His description comes from hadith, mainly in the Sunan collections. The Prophet ﷺ said that even if only one day of this world remained, Allah would lengthen it until He sends a man from his family whose name matches his own name and whose father's name matches his father's, and who will fill the earth with fairness and justice as it had been filled with oppression (Sunan Abi Dawud 4282). In another narration he said the Mahdi is from his family, from the descendants of Fatimah (Sunan Abi Dawud 4284).
From these reports, Sunni scholars summarise that his name will be Muhammad ibn Abdullah, he will be a descendant of the Prophet ﷺ through Fatimah, and he will lead the Muslims for a number of years in a time of great justice and blessing.
The Mahdi and Jesus
Muslims believe Jesus (Isa) will return before the Day of Judgement. Many scholars link the Mahdi to that moment. The Prophet ﷺ described Jesus descending while the Muslims are about to pray: their leader invites him to lead the prayer, but Jesus declines and prays behind him, as an honour for this community (Sahih Muslim 156). Scholars commonly identify that leader as the Mahdi. See Do Muslims believe Jesus will come back?
Sunni and Shia views
- Most Sunnis: the Mahdi will be born at a future time, grow up as an ordinary man and be recognised later. Belief in him is widely held, though a few scholars have questioned some of the narrations.
- Twelver Shia: the Mahdi is the twelfth Imam, Muhammad ibn al-Hasan, who they believe was born in the 9th century and is in hiding (occultation) until he returns.
As a new Muslim, you don't need to settle every detail. The core belief is simple: Allah will send justice before the end, and the Prophet ﷺ told us about it. See What are the signs of the Day of Judgement?
Beware of false Mahdis
Throughout history, many men have claimed to be the Mahdi, and some groups still use the idea to recruit people or justify violence. A real sign of the end is not something you "join" through a website or a charismatic preacher. If someone online tells you the Mahdi has arrived and you must follow him, walk away. See How do I spot extremist teachings online as a new Muslim?
- The Mahdi is a just leader from the Prophet's family, described in hadith.
- He is not mentioned by name in the Quran.
- Sunnis and Shia hold different views on who he is and when he appears.
- Be very cautious of anyone claiming to be the Mahdi today.
People also ask
When will the Day of Judgement happen?
No one knows when the Day of Judgement will happen except Allah. Islam teaches it comes suddenly, on a Friday, after major signs.
Read the full answer →Who are Gog and Magog in Islam?
Gog and Magog (Ya'juj and Ma'juj) are huge nations held behind a barrier who will break out near the end of time, a major sign of the Hour.
Read the full answer →Can Muslims believe in ghosts?
No, Muslims don't believe in ghosts of the dead: souls stay in the barzakh. But jinn are real. How Islam explains hauntings.
Read the full answer →Is Iblis an angel or a jinn?
Iblis is a jinn, not an angel: the Quran says "he was of the jinn" and made from fire. Why some think otherwise and why it matters.
Read the full answer →Can jinn be Muslim?
Yes, jinn can be Muslim. The Quran tells of jinn who heard the Quran and believed. What Muslim jinn do and why you shouldn't contact them.
Read the full answer →