The Prophet ﷺ said, "Whoever catches one rakah of Fajr before the sun rises has caught it, and whoever catches one rakah of Asr before the sun sets has caught it. Whoever catches one rakah of Fajr before the sun rises has caught it, and whoever catches one rakah of Asr before the sun sets has caught it."
أخبرنا محمد بن رافع قال حدثنا زكريا بن عدي قال أنبأنا ابن المبارك عن يونس بن يزيد عن الزهري عن عروة
عن النبي ﷺ قال من أدرك ركعة من الفجر قبل أن تطلع الشمس فقد أدركها ومن أدرك ركعة من العصر قبل أن تغرب الشمس فقد أدركها ومن أدرك ركعة من الفجر قبل أن تطلع الشمس فقد أدركها ومن أدرك ركعة من العصر قبل أن تغرب الشمس فقد أدركها
Muslim narrated it, Mosques, chapter of whoever catches a rakat of the prayer has caught that prayer, hadith 609, from the hadith of Ibn Mubarak with the same wording, and it is also in Al-Kubra, hadith 1533.