The Messenger of Allah ﷺ said, "Whoever catches one rakah of the prayer has caught the prayer."
أن رسول الله ﷺ قال: من أدرك ركعة من الصلاة فقد أدرك الصلاة.
Malik narrated it in "The Times of Prayer" (15), from Ibn Shihab, from Abu Salama bin Abdul-Rahman, from Abu Hurairah, and he related it. Bukhari narrated it in "The Times of Prayer" (580), and Muslim in "Mosques" (607), both of them through the route of Malik, with the same wording.