Is it valid for a person praying alone (Munfarid) to have someone join them later and form a congregation by intending to follow the initial solo worshipper in an obligatory (Fard) prayer?
Chapter on Imamate and Congregational Prayer
Al-Mughni
Book of Prayer
Primary text
If the initial person praying alone is waiting for someone, such as an appointed mosque Imam, it is permissible for him to begin alone and then pray with those who subsequently join. Ahmad affirmed this based on the report that the Prophet (peace be upon him) began prayer alone, and then Jabir and Jabbarah joined him, and he led them; the Prophet did not disapprove of their action. It is presumed this was an obligatory prayer as they were traveling.
Supporting text
If the initial person was not waiting for others, it is reported from Ahmad that this is not valid. This view is held by Al-Thawri, Ishaq, and the People of Opinion (Ashab al-Ra'y) for both obligatory and supererogatory prayers, as the intention of leading was not established at the prayer's inception, making it invalid, similar to following someone who was intended to be led. However, the soundest opinion, consistent with Shafi'i's view, is that it is valid for the obligatory prayer as well, supported by the precedent in supererogatory prayer established by the Hadith of Ibn Abbas and the Hadith of Aisha, where people joined the Prophet's night prayer. Furthermore, necessity dictates that the intention to lead can be transferred, analogous to the case of deputizing an Imam (Istikhlaf), as abandoning the prayer or stating the invalidity later would lead to greater consequences.