The last words of the Messenger of Allah ﷺ were, "The prayer, the prayer. Fear Allah regarding those whom your right hands possess."
كان آخر كلام رسول الله ﷺ: الصلاة، الصلاة، اتقوا الله فيما ملكت أيمانكم.
Reported by Abu Dawud (5156) and Ibn Majah (2698), both from the hadith of Muhammad bin Fudayl, from Mughira, from Umm Musa, from Ali, as mentioned. Its chain is hasan because of Umm Musa, who was Ali's concubine. It is said her name was Fakhita, and it is also said Habiba. Mughira bin Miqsam Dubai narrated from her. Daraqutni said, "Her hadith is sound, and her hadith is cited for corroboration." Ajli said, "A Kufan successor, trustworthy."On this subject there is also a report from Umm Salama that the Messenger of Allah, during his final illness, used to say, "Prayer, and those whom your right hands possess," and he kept repeating it until his tongue could no longer utter it clearly. Reported by Ibn Majah (1625), Ahmad (2665, 26727), and Abu Yaala (6979), all from the hadith of Hammam, from Qatada, from Salih Abu Khalil, from Safina, from Umm Salama, as mentioned.Its narrators are trustworthy, but there is a break in the chain, for Salih, who is Ibn Abu Maryam Dubai, their freedman, known as Abu Khalil, narrates from Safina in a disconnected (mursal) manner. However, Hammam's narration from Qatada is more sound (asahh) than the narration of Sulayman Taymi from Qatada from Anas, which is discussed below.Ibn Abu Hatim said, "I asked my father and Abu Zura about a hadith narrated by Mutamir bin Sulayman, from his father, from Qatada, from Anas, who said, 'The bulk of the Messenger of Allah's final instruction, when death approached him, was, "Prayer, and those whom your right hands possess."' My father said, We consider this to be a mistake, and the sound version is the hadith of Hammam, from Qatada, from Salih Abu Khalil, from Safina, from Umm Salama, from the Prophet. Abu Zura said, Saeed bin Abu Aruba narrated it, saying, from Qatada, from Safina, from Umm Salama, from the Prophet, and he said, Ibn Abu Aruba has the stronger memory, but Hammam's hadith is more likely correct, for Hammam added a man to the chain." End of quote, from Ilal (1/110–111).The hadith of Saeed bin Abu Aruba was reported by Ahmad (26483, 26684), and Nasai in Sunan al-Kubra (7098), from Qatada, that Safina, the freedman of Umm Salama, narrated from Umm Salama, as mentioned. Nasai said, "Qatada did not hear it directly from Safina."As for the hadith of Anas, it was reported by Ibn Majah (2697), Ahmad (12169), and Ibn Hibban (6605), all from the hadith of Sulayman Taymi, from Qatada, from Anas, who said, "The last instruction of the Messenger of Allah, which he uttered as he gargled with it in his chest, and which his tongue could barely bring forth clearly, was, 'Prayer, prayer, fear Allah regarding those whom your right hands possess.'"As for Hakim (3/57), he reported it by this same route, but he dropped "Qatada" between Sulayman and Anas, making it directly from Sulayman to Anas. Nasai said, "Sulayman Taymi did not hear this hadith from Anas." Sunan al-Kubra (7095). Then Nasai reported it in Sunan al-Kubra (7096) from the hadith of Sulayman, from Qatada, from a companion of his, from Anas, similarly. This is the defect in this chain.Taken together, these hadiths strengthen the hadith of Ali bin Abu Talib and indicate that it has a genuine basis.