The Messenger of Allah ﷺ addressed them while leaning his back against the Kaabah and said, "There is no prayer after the afternoon prayer until the sun sets, and no prayer after the morning prayer until the sun rises."
إن رسول الله ﷺ خطبهم وهو مسند ظهره إلى الكعبة فقال: لا صلاة بعد العصر حتى تغرب الشمس، ولا صلاة بعد صلاة الغداة حتى تطلع الشمس.
Imam Ahmad narrated it (6970) from Abdul-Samad (Ibn Abdul-Warith), who said, "Khalifa narrated to us, from Amr bin Shuayb, from his father, from his grandfather (Abdullah bin Amr bin As)," and he mentioned something similar.Abu Dawud Tayalisi also narrated it (2374) from Khalifa bin Khayat with the same wording. This is in fact a portion of the longer hadith, each portion of which will come in its proper place.Khalifa bin Khayat, Abu Hubayra, was mentioned by Ibn Hibban in Thiqat (6/229). He has been corroborated, as will come later. He is the grandfather of Khalifa bin Khayat bin Khalifa bin Khayat Usfuri, Abu Amr Basri, whose nickname was Shabab, the historian, one of the teachers of Bukhari and others, who died in the year two hundred forty.Imam Ahmad narrated it (6681) from Yahya (bin Saeed Qattan), from Husayn (who is Ibn Zakwan), from Amr bin Shuayb, from his father, from his grandfather, in a long hadith which includes, "There is no prayer after dawn until the sun rises, and no prayer after Asr until the sun sets." This is a strong corroboration of what preceded.Haythami said in Majmaa (3355), "Ahmad narrated it, and its narrators are thiqat." He also said, "It is sahih that there is a prohibition against prayer after sunrise."