If somebody is leading the Salat (prayer) and (in the meanwhile) the first (usual) Imam comes, the Salat is valid whether the former retreats or does not retreat
حَدَّثَنَا مُسْلِمٌ ـ يَعْنِي ابْنَ إِبْرَاهِيمَ ـ حَدَّثَنَا هِشَامٌ، حَدَّثَنَا يَحْيَى، عَنْ أَبِي سَلَمَةَ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ ـ رضى الله عنه ـ عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ إِذَا رَأَيْتُمُ الْجَنَازَةَ فَقُومُوا، فَمَنْ تَبِعَهَا فَلاَ يَقْعُدْ حَتَّى تُوضَعَ "
Narrated Abu Sa`id Al-Khudri:
The Prophet (ﷺ) said, "When you see a funeral procession, you should stand up, and whoever accompanies it should not sit till the coffin is put down."
Reference: Sahih al-Bukhari 1310 In-book : Book 23, Hadith 69 USC-MSA web (English) : Vol. 2, Book 23, Hadith 397 (deprecated)
Help us gift a modern, ad-free Islamic application for the Muslim Ummah. Your donation will be recorded as Sadaqah Jariyah in your book of deeds, In Sha Allah.