It was recorded by al-Bukhari (1/357/247), Muslim (8/77), Abu Dawud (5046–5047), al-Tirmidhi (3569), who graded it authentic, al-Nasa’i (781 and 782), Ibn Hibban (5511), al-Tabarani in al-Du‘a’ (2/905/245), Ahmad (4/293), and al-Bayhaqi in Shu‘ab al-Iman (4/173/4704), through several chains from Mansur, with this wording.
Muslim, al-Nasa’i (783–785), Ibn Abi Shaybah (9/73/6577 and 10/246/9345), and Ahmad (4/246) also recorded it through several chains from Sa‘d ibn Ubaydah, with similar wording.
A third chain: al-Humaydi said in his Musnad (316/723): Sufyan narrated to us: Abu Ishaq al-Hamdani narrated to us: I heard al-Bara’ ibn ‘Azib say: The Messenger of Allah, peace and blessings be upon him, would say when lying down, or he instructed that it be said when lying down, or he instructed me to say when I lay down—Sufyan was uncertain, not knowing which of these it was—he said: “O Allah…” then he mentioned the hadith.
I say: This is an authentic chain, continuous through direct hearing: Sufyan—namely, Ibn ‘Uyaynah—heard from Abu Ishaq—namely, al-Sabi‘i—before the latter became confused in his transmissions; and Abu Ishaq explicitly stated that he heard it from al-Bara’. Thus, we are secure from both his concealment in transmission and his later confusion. However, Sufyan was uncertain concerning the text of the hadith: whether it described an action of the Prophet, peace and blessings be upon him—namely, that he would say it when lying down—or whether he instructed someone else to say it. Reports from Abu Ishaq, narrated by Sufyan and others from him, as well as by others, have come with both versions. The details are as follows:
First: from Sufyan ibn ‘Uyaynah, from him. It was recorded by al-Tirmidhi (3391), al-Ruyani in his Musnad (f. 84/2–85/1), and al-Tabarani in al-Du‘a’ (2/903/241), through several chains from him, with the wording of an instruction—the first with the wording: