I have reservations about its authenticity, since nothing has been transmitted to compensate for its weakness. It appears to be a narration by meaning of the other part of the hadith: “O Allah, befriend whoever befriends him and be hostile to whoever is hostile to him.” Similar to this is ʿUmar’s statement to ʿAlī: “This morning and evening, you have become the mawla of every believing man and woman.” This too is not authentic, since ʿAlī ibn Zayd alone narrated it, as noted above.
Now that you understand this, what prompted me to examine the hadith closely and clarify its authenticity was that I found Shaykh al-Islam Ibn Taymiyyah had declared the first part of the hadith weak; as for the other part, he claimed that it was fabricated (1)! This is one of his exaggerations, resulting, in my view, from his haste in declaring hadiths weak before collecting all their chains and carefully scrutinizing them. And Allah is the One whose help is sought.
As for what the Shiʿah allege regarding this hadith and others—that the Prophet, peace and blessings be upon him, said concerning ʿAlī, may Allah be pleased with him, “He is my successor after me”—it is not authentic in any way whatsoever. Rather, it is one of their many falsehoods, whose mendacity historical reality itself has demonstrated. For had the Prophet, peace and blessings be upon him, said it, it would have come to pass as he said, since it would have been revelation revealed; and Allah, glorified and exalted is He, does not fail His promise. I have traced some of their hadiths concerning this in my other book, al-Ḍaʿīfah, (4923 and 4932), among a collection of their reports adduced by ʿAbd al-Ḥusayn in al-Murājaʿāt. There I explained their weakness and invalidity, as well as his own falsehood in some of them and his fabrications against the imams of the Sunnah concerning them.
1751 — “O my brothers! Prepare for a day such as this.”
Al-Bukhārī recorded it in al-Tārīkh (8/1/229), as did Ibn Mājah (4195), Aḥmad (4/294), Abū Bakr al-Shāfiʿī in Majlisān (6/2), al-Rūyānī in his Musnad (folio 96/1), and al-Khaṭīb in al-Tārīkh (1/341), through Abū Rajāʾ ʿAbdullāh ibn Wāqid al-Harawī, who said: Muḥammad ibn Mālik narrated to us from al-Barāʾ ibn ʿĀzib, who said: