What is the ruling on the prayer of someone who entered the mosque assuming that another worshipper was performing a separate congregational prayer, so he prayed beside him, then completed his prayer as an imam for those who came after him, and did not complete it with the first imam? And what is the ruling on the prayer of the congregants who prayed behind him?
It is permissible to follow a latecomer (masbuq) if he stands up to complete his prayer, because the intention of leading (imamah) is not required from the beginning of the prayer. This is supported by evidence allowing a worshiper to transition from praying alone to leading, and from leading to being led.
If a Muslim enters a mosque and finds someone praying alone, he may join him, and the prayer becomes valid as a congregational prayer.
However, it is not permissible for a person to be both a follower (ma'mum) and a leader (imam) at the same time, by consensus. Therefore, if someone follows a person who is himself following a latecomer, his prayer is invalid, because it is not permissible to be both a follower and a leader.
If the worshiper changes his intention and intends to pray alone, then if someone follows him at that moment, and the worshiper intends to be an imam for him, his prayer is valid.
Similarly, anyone who intends to follow a person after the latecomer has given his salutation, his prayer is valid, because he is following him at a time when he is not a follower of anyone else.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/11479