Is it permissible to pray in the outer courtyard of the mosque or on the upper floor if there is still space inside the mosque, or if we are compelled to pray outside the mosque's boundaries due to intense heat while the imam is inside and the mosque is not full?
Praying outside the mosque when there is ample space inside it is contrary to the Sunnah, as the principle is to complete the rows, first the front, then the next. However, the prayer of one who prays outside is valid if he sees the Imam or the congregants. If he does not see them due to a barrier, then there is a difference of opinion among scholars regarding the validity of their following. Praying on the roof of the mosque or in its basement when there is ample space within the mosque is considered contrary to the Sunnah, but it is valid because the roof and basement of the mosque are part of the mosque.
Summarized from the full answer at Ftawy · reviewed Sep 2, 2026
Read the full answer on Ftawyhttps://ftawy.com/en/questions/120438