I then found another chain for it from Jābir, explicitly stating that he heard it from the Prophet, peace and blessings be upon him. Al-Khaṭīb transmitted it (12/250–251) through the route of ʿAbbās ibn Muḥammad al-Dūrī: ʿĀṣim ibn ʿUmar al-Muqaddamī narrated to us; his father narrated to us, from Fiṭr ibn Khalīfah, from Abū Khalīfah, from Abū Khālid al-Wālibī, who said: Jābir ibn Samurah al-Suwāʾī narrated to us, saying: “I heard the Messenger of Allah, peace and blessings be upon him, say: ‘This matter will continue to prevail; whoever opposes it will not harm it.’”
He also said: ʿĀṣim ibn ʿUmar al-Muqaddamī narrated to us; his father narrated to us, from Fiṭr ibn Khalīfah, from Maʿd ibn Khālid al-Jadalī, from Jābir ibn Samurah, from the Prophet, peace and blessings be upon him, with the same wording. The narrators in both chains are trustworthy, except that the first chain includes Abū Khālid al-Wālibī, whom al-Taqrīb describes as “acceptable”—that is, weak in hadith. As for Abū Khalīfah, who narrates from him, I have not been able to identify him. Perhaps the original reading was: Fiṭr ibn Khalīfah ibn Abī Khalīfah, and the word “ibn” was miscopied by the scribe as “from,” as frequently occurs in chains of transmission. And Allah knows best.
The hadith has also been authenticated through another chain, with the wording:
“The religion will remain firmly established until the Hour comes, or until there are twelve caliphs ruling over you, all of them from Quraysh.”