A hadith like this has been narrated by Hammam b. Munabbih on the authority of Abu Huraira.
Sahih Muslim Book 5, Hadith 345
← Previous Hadith
The Messenger of Allah (ﷺ) said: Anyone amongst you who sat in a place of worship waiting for the prayer is in prayer and his ablution is not broken, the angels invoke blessing upon him (in these words): O Allah! pardon him. O Allah! have mercy upon him.
Sahih Muslim Book 5, Hadith 344 Next Hadith → The most eminent among human beings (as a recipient of) reward (is one) who lives farthest away, and who has to walk the farthest distance, and he who waits for the prayer to observe it along with the Imam, his reward is greater than one who prays (alone) and then goes to sleep. In the narration of Abu Kuraib (the words are):" (He waits) till he prays along with the Imam in congregation."
Sahih Muslim Book 5, Hadith 346
Sahih Muslim Book 5, Hadith 344 Next Hadith → The most eminent among human beings (as a recipient of) reward (is one) who lives farthest away, and who has to walk the farthest distance, and he who waits for the prayer to observe it along with the Imam, his reward is greater than one who prays (alone) and then goes to sleep. In the narration of Abu Kuraib (the words are):" (He waits) till he prays along with the Imam in congregation."
Sahih Muslim Book 5, Hadith 346