The Messenger of Allah ﷺ said, "Whoever catches one rakah of the prayer has caught the prayer."
أخبرنا قتيبة عن مالك عن ابن شهاب عن أبي سلمة
أن رسول الله ﷺ قال من أدرك من الصلاة ركعة فقد أدرك الصلاة
Bukhari narrated it in Mawaqit Salah, chapter on whoever catches a rakat of the prayer, hadith 580, and Muslim in Masajid, chapter on whoever catches a rakat of the prayer, hadith 607, from the hadith of Malik through this same chain. It is also found in Muwatta (Yahya), 1/10, and in Kubra, hadith 1537.