Belief in the Mahdi (the 'guided' latter-day ruler who will establish justice) is deeply rooted in Islam, and is an obligatory part of belief in the view of some ulama. There may be differences of opinion on the characteristics and the person of the Mahdi ,but all are of the opinion that most of the traditions on the Mahdi are right and that the tidings about him are mutawatir.
In addition to the direct references to the Mahdi in Sahih Bukhari and Sahih Muslim, there are also almost 50 traditions, with direct reference to the Mahdi, in other well-known collections such as Abu Daud, Tirmizi, Musnad-i Ahmad bin Hanbal, Ibn Maja, Tabarani (in all the three collections: Al-Kabir, Al-Awsat and Al-Saghir), Al-Hakim (Mustadrak), Abu Ya'li, al-Bazzar, Ibn Hibban, Abu al-Shaykh (Kitab al-Fitan), Ibn Asakir, Ibn Adi, Abu Na'im (Akhbar al-Mahdi), Al-Royani (Musnad), al-Dailami, Al-Dani (Sunan), Ibn Mandah, Na'im ibn Hammad (Kitab al-Fitan), Al-Harith ibn Ali Usamah (Musnad), Al-Khatib al-Baghdadi (Tarikh), Ibn Abi Shaibah (Musannaf), Al-Darqutni, Abu Na'im (Dalail al-Nubuwwah and al-Hilyah), Ibn al-Munadi (Al-Malahim), Abu Ghannam al-Kufi (Kitab al-Fitan), Tammam (Fawaid), Ibn Sa'd (Tabaqat), Ibn Jarir (Tafsir), Al-Muhami (Al-Amali), etc.
These authoritative source books contain almost 50 traditions of the Prophet, (Peace and benediction be upon him and his infallible progeny) which clearly foretell the emergence of the Mahdi before the Day of Resurrection. Many of these traditions are 'Sahih' and directly narrated on the authority of the Prophet by 33 well-known companions, who include: Ali ibn Abi Talib, Husayn ibn Ali, Abu Sa'id al-Khudari, Abdullah ibn Mas'ud, Umm Salmah, Thauban, Abu Hurayrah, Anas ibn Malik, Jabir ibn Abdullah, Uthman ibn Affan, Awf ibn Malik, Talha ibn Ubaidallah, Huzaifah ibn al-Yaman, Umran ibn Husayn, Abdullah ibn Umar, Ayesha, Abdul Rahman ibn Awf, Abu Ayyub al-Ansari, Ibn Abbas, Tamim al-Dari, Umm Habibah, Abbas ibn Abdil Muttalib and Ammar ibn Yasir.
The most famous of these traditions is the one narrated by Abdullah ibn Mas'ud in which the Prophet said: "Even if a (single) day is left in (the life of) the world, Allah will lengthen that day to send a person of my House whose name will be like my name and whose Kunyah will be similar to mine. He will fill the world with justice and equity just as it was previously full of injustice and oppression". (Abu Daud, Tabarani, Ibn Hibban, Hakim, Ibn Maja, Abu Na'im, Ibn Asakir etc).
This and many other traditions are in accordance with the highest standards of scrutiny set by the traditionists and therefore it is the consensus of Islamic scholars of all ages that the tradition is true and mutawatir (uninterruptedly conveyed on the authority of the Prophet). Following is a selection of affirmative references to the Mahdi by Muslim authorities from the old to the modern times: