Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ahmad:645Faḍl b. Dukayn > Yāsīn al-ʿIjlī > Ibrāhīm b. Muḥammad Ibn al-Ḥanafiyyah from his father > ʿAlī

The Messenger of Allah ﷺ said: “The Mahdi is one of us’ Ahlal-Bait (the prophet’s family) and Allah will prepare him in one night”.  

أحمد:٦٤٥حَدَّثَنَا فَضْلُ بْنُ دُكَيْنٍ حَدَّثَنَا يَاسِينُ الْعِجْلِيُّ عَنْ إِبْرَاهِيمَ بْنِ مُحَمَّدِ ابْنِ الْحَنَفِيَّةِ عَنْ أَبِيهِ عَنْ عَلِيٍّ قَالَ

قَالَ رَسُولُ اللهِ ﷺ الْمَهْدِيُّ مِنَّا أَهْلَ الْبَيْتِ يُصْلِحُهُ اللهُ فِي لَيْلَةٍ  


See similar narrations below:

Collected by Ibn Mājah, Suyūṭī

Allah will make the Mahdī righteous overnight, hence his title, the Mahdī (the One Rightly Guided)

ibnmajah:4085ʿUthmān b. Abū Shaybah > Abū Dāwud al-Ḥafarī > Yāsīn > Ibrāhīm b. Muḥammad Ibn al-Ḥanafiyyah from his father > ʿAlī

"Mahdi is one of us, the people of the Household. Allah will rectify him in a single night."  

ابن ماجة:٤٠٨٥حَدَّثَنَا عُثْمَانُ بْنُ أَبِي شَيْبَةَ حَدَّثَنَا أَبُو دَاوُدَ الْحَفَرِيُّ حَدَّثَنَا يَاسِينُ عَنْ إِبْرَاهِيمَ بْنِ مُحَمَّدِ ابْنِ الْحَنَفِيَّةِ عَنْ أَبِيهِ عَنْ عَلِيٍّ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ الْمَهْدِيُّ مِنَّا أَهْلَ الْبَيْتِ يُصْلِحُهُ اللَّهُ فِي لَيْلَةٍ