Hadithcore
Mishkat al-Masabih, 1412

Abu Huraira reported God’s Messenger as saying, “If anyone is in time for a <i>rak‘a</i> in the prayer along with the <i>imam</i> he has said the whole prayer.” (Bukhari and Muslim.)

وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: مَنْ أَدْرَكَ رَكْعَةً مِنَ الصَّلَاةِ مَعَ الإِمَام فقد أدْرك الصَّلَاة كلهَا "

References1 variant
In-Book Reference
Book 4, Hadith 813