In the chaos and corruption that will precede the end of the world, the Muslim faithful will be awaiting a deliverer. His name will be Muhammad ibn Abdullah al-Mahdi — "the Guided One." He will be a descendant of the Prophet Muhammad through his daughter Fatima. He will appear in Mecca, fleeing from assassins, and the people will press allegiance upon him between the sacred corner of the Kaaba and the Station of Abraham. He will fill the earth with justice and equity after it has been filled with injustice and oppression. He will rule for seven, eight, or nine years — his reign a golden age of righteousness, where the earth will yield its crops, the sky will rain abundance, and wealth will flow such that a man will stand with his wealth, calling out: "Who will accept my charity?" — and none will come. But his reign will also be a time of war. The Dajjal — the false messiah — will emerge, and the Mahdi will prepare the armies of the faithful for the final apocalyptic battle. Jesus, the son of Mary, will descend from the heavens to lead the prayers behind the Mahdi. Together, they will defeat the forces of evil. The Mahdi will die before the end — a mortal, not a messiah — and the believers will pray over his body. The figure of the Mahdi is one of the most important and widely reported themes in Islamic eschatology. He is not mentioned explicitly in the Quran but appears in dozens of hadiths accepted by Sunni and Shia scholars alike. For the Shia, the Mahdi is the 12th Imam — Muhammad al-Mahdi — who went into occultation in 874 AD and will return at the end of time. The Mahdi is a figure of hope: the promise that the world, no matter how dark it becomes, will finally know a ruler who governs with absolute justice.
Summary: The Mahdi is a figure of eschatological hope in Islam. In Sunni tradition, he is a descendant of the Prophet Muhammad who will appear near the end of time, rule with justice, and fight the Dajjal alongside Jesus. In Shia Islam, the Mahdi is the 12th Imam, Muhammad al-Mahdi, who entered occultation in 874. Key hadiths in Sunan Abu Dawud, Ibn Majah, and others describe him. He will appear in Mecca, be pledged allegiance at the Kaaba, and his name will match the Prophet's name. He will fill the earth with justice. He is a sign that precedes the Dajjal and the return of Jesus.
🕋 The Emergence from Mecca
The hadiths describe the Mahdi's emergence during a time of great division and crisis. He will flee from Medina to Mecca. The people of insight will recognize him — his face shining with piety, his forehead marked by frequent prostration. He will resist, claiming he is not the Mahdi, but the people will force the pledge upon him. An army from Syria will march against him, but the earth will swallow them in the desert between Mecca and Medina — the "Bayda" sign.
The Pledge at the Kaaba
"A man will flee from Medina to Mecca. The people will seek him between the Rukn (the Corner of the Black Stone) and the Maqam (the Station of Abraham). They will force the pledge of allegiance upon him. An army from Syria will march against him, and the earth will swallow them at Bayda between Mecca and Medina."
☀️ Sunni vs. Shia Perspective
For Sunni Muslims, the Mahdi is a future figure who will be born and appear at the appointed time. For Shia Muslims (especially Twelver Shia), the Mahdi has already been born — Muhammad al-Mahdi, the 12th Imam, born in 869 AD. He entered "occultation" (ghayba) in 874, hiding from persecution. He is believed to be alive, in hiding, and will return at the end of time as the Mahdi. This is a theological difference of profound significance between the two branches of Islam.
⚔️ The Mahdi and the Dajjal
The Mahdi's role is to prepare the world for the return of Jesus. When the Dajjal appears — the false messiah — the Mahdi will lead the Muslim army. According to some accounts, seven or eight years into the Mahdi's reign, Jesus will descend from the sky near the white minaret east of Damascus. He will pray behind the Mahdi, establishing the Mahdi's leadership. Together, they will pursue the Dajjal, who will be killed by Jesus at the Gate of Ludd (Lod).