Sunan Abi Dawud, Book 2, Hadith 732 (Abu Dawud 1122)

Abu Hurairah reported the Messenger of Allah (ﷺ) as saying:

If anyone obtains a rak'ah in the prayer (along with the imam), he has obtained the whole prayer.