I heard the Messenger of Allah ﷺ say, "The Mahdi is from my family, from the descendants of Fatimah."
سمعت رسول الله ﷺ يقول: المهدي من عترتي، من ولد فاطمة.
It was narrated by Abu Dawud (4284), and the wording is his, Ibn Majah (4086), and Hakim (4/557), all of them through the route of Abu Malih Hasan bin Umar, from Ziyad bin Bayan, from Ali bin Nufayl, from Saeed bin Musayab, from Umm Salama, who said, and she mentioned it.Its chain is hasan because of Ali bin Nufayl and Ziyad bin Bayan, for the two of them make the hadith hasan. However, Bukhari included this hadith in the biography of Ziyad bin Bayan in Tarikh al-Kabir (3/346) and said, "There is something questionable in its chain," and Aqeeli and Ibn Adi and others followed him in this. Ibn Jawzi said in Ilal Mutanahiya, "This is a well-known statement from the words of Saeed bin Musayab, and it appears that Ziyad bin Bayan erred in raising it to the Prophet."I say, he is pointing to what Naeem bin Hammad narrated in al-Fitan (1022), and Dani in al-Fitan (575, 581), both of them through the route of Qatada, who said, I said to Saeed bin Musayab, "Is the Mahdi real?" He said, "Real." I said, "From whom will he be?" He said, "From Quraysh." I said, "From which branch of Quraysh?" He said, "From Banu Hashim." I said, "From which branch of Banu Hashim?" He said, "From Banu Abdul-Muttalib." I said, "From which branch of Abdul-Muttalib?" He said, "From the offspring of Fatimah."I say, this is a matter of the unseen, so there must be some basis for Saeed bin Musayab that he was relying on, and this narration makes clear that his basis was the hadith of Umm Salama. Sometimes he would trace it back with a chain, and sometimes he would give it as a legal opinion when asked. It has been established in more than one hadith that the Mahdi is from the household of the Prophet ﷺ, and the lineage of the Prophet ﷺ continued only through the offspring of Fatimah, so there is no contradiction at all in the hadith of Umm Salama. And Allah knows best.