The Prophet ﷺ said, "Whoever catches one rakah of the Asr prayer before the sun sets, or catches one rakah of the Fajr prayer before the sun rises, has caught the prayer."
أخبرنا محمد بن عبد الأعلى قال حدثنا معتمر قال سمعت معمرا عن الزهري عن أبي سلمة
عن النبي ﷺ قال من أدرك ركعة من صلاة العصر قبل أن تغيب الشمس أو أدرك ركعة من الفجر قبل طلوع الشمس فقد أدرك
Muslim recorded it, no. 162/607. See the previous hadith from Muamar bin Rashid. Bukhari also recorded it in the Book of Prayer Times, chapter on one who catches a rakat of Asr before sunset, no. 556, from the hadith of Abu Salama, with the same wording. It is also in al-Kubra, no. 1503. Ibn Khuzayma recorded it in his Sahih, no. 985, from Muhammad bin Abdul-Ala, with the same wording.