Mahdi means `guided` but, as all men are led by God, it comes to mean one who stands in an especially close relation to Him. It may be noted that it is a favourite name for converts to Islam. It was applied as a title of respect to the four orthodox Caliphs, and to some of the Umayyads by their admirers. In its technical religious sense it was given to a son of Ali, Muhammad, the son of the woman of the tribe of Hanifa, though he himself would have nothing to do with it. After his death he was believed to be hidden on a mountain in Arabia, miraculously fed and guarded, till he should return to rule in righteousness. Belief in the return was common especially among the extreme Shias. Sometimes it was the return of the Imam as Mahdi, sometimes of the whole people. The Mahdi is the ruler who will restore all things and usher in the golden age.
Muslims speak of the `determinants of the Hour`. It is believed that the world will go from bad to worse till wickedness is universal. Then the sun will rise in the west and there will be three eclipses, in the west, the east, and Arabia. God and Magog will break through Alexander`s wall and overrun the earth. Dajjal, a gigantic king living on an island in the Indian Ocean, will appear somewhere in Asia and in forty days will conquer the world; Jesus Christ and the Mahdi will come down to earth and Jesus will help the Mahdi to lull Dajjal, kill all swine, and will re-establish the Muslim faith. Jesus will pray behind the Mahdi who will rule for seven, eight, or nine years of peace and plenty when gold will be as the dust of the earth. The Mahdi will die and prayers be said over him.
There is no systematic layout or consensus regarding where the Mahadi will come from. There was talk of a Sufyani Mahdi, a representative of the elder branch of the Umayyads, who would take vengeance on the rulers of the Abbasid dynasty and restore the fortunes of his family. The name is derived from Abu Sufyan the ancestor of the family. The southern Arabs in their turn looked for a Qahtani Mahdi to restore the ancient glory of that branch of the nation. While most expected the Mahdi to come from the east, others have said he will come from the West.
The significance of Mahdi, however, differs from one Islamic sect to the other. Thus for some Mahdi is an essential element of religion while others consider him as a piece of popular religion.