Is it permissible for someone who has prayed the obligatory prayer at home, then caught up with the congregation at the mosque having missed one or more rak'ahs, to say the taslim with the Imam, or must he complete what he missed?
It is recommended for someone who prayed a fard (obligatory) prayer at home and then came to the mosque and found a congregation praying the same fard prayer, to repeat it with them to attain the virtue of congregational prayer. This is based on the Prophet's (peace be upon him) saying: "If you have prayed in your dwellings, then come to a mosque where a congregation is praying, pray with them, for it will be a supererogatory prayer for you." This applies to someone who prayed alone or in a congregation and then found another congregation.
If a person intends for their joining the congregation to be a supererogatory prayer and the Imam is praying four rak'ahs, and they join in the third rak'ah, they may salam with the Imam, thus having prayed two rak'ahs. However, if they join in the second rak'ah of the 'Isha prayer, they should perform one more rak'ah after the Imam's salam to make their prayer an even number, unless they intend it as Witr, in which case they salam with the Imam.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/194999