The Messenger of Allah ﷺ said, "Whoever catches one rakah of the Asr prayer before the sun sets has caught the prayer, and whoever catches one rakah of the Fajr prayer before the sun rises has caught the prayer."
حدثنا محمد بن الصباح حدثنا عبد العزيز بن محمد الدراوردي أخبرني زيد بن أسلم عن عطاء بن يسار وعن بسر بن سعيد وعن الأعرج يحدثونه
أن رسول الله ﷺ قال من أدرك من العصر ركعة قبل أن تغرب الشمس فقد أدركها ومن أدرك من الصبح ركعة قبل أن تطلع الشمس فقد أدركها
Bukhari narrated it in "The Times of Prayer," in the chapter "Whoever catches one rakat of Fajr," Hadith 579, and so on, Hadith 608, from the hadith of Zayd, in this manner. And Muslim narrated it in "Mosques," in the chapter "Whoever catches one rakat."