Short answer
Yes, in the Hanafi school your prayer is valid, but standing alone behind a row is makruh when there is room in the row in front. If the row is full, the preferred view in the Hanafi school today is to stand alone behind the imam's centre rather than pull someone back. The Hanbali school holds that a whole rakah alone behind the row invalidates the prayer.
Praying alone behind a row is valid. It is makruh if there is a gap in the row ahead that you could fill. If the row is full, wait briefly for someone to join you; if no one comes, stand alone behind the middle. Pulling someone back from a full row is allowed in principle, but later Hanafi scholars advise against it because most people do not know the ruling.
Other madhhabs
- Shafi'i
- Valid but disliked; if the row is full, it is recommended to gently draw one person back to stand with you.
- Hanbali
- Praying a full rakah alone behind the row without excuse invalidates the prayer; if no space can be made, some Hanbali scholars allow it.
Explanation
Wabisah reported that the Prophet ﷺ saw a man praying alone behind the row and told him to repeat the prayer. The Hanbali school takes this literally. Abu Bakrah, on the other hand, bowed before reaching the row and walked into it in ruku, and the Prophet ﷺ told him, "May Allah increase your keenness, but do not do it again", without telling him to repeat. The Hanafi, Shafi'i and Maliki schools combine the two and say the prayer is valid but the act is disliked; they read the command to repeat as a recommendation.
What to do when you arrive:
- There is a gap in a row ahead: go and fill it, even if it means passing in front of the back row. Leaving a gap and standing alone is makruh.
- The row ahead is full: wait a moment for someone else to come so you can form a new row together.
- No one comes and you would miss the rakah: stand alone behind the middle of the row and join the imam. Your prayer is valid.
- Pulling someone back: the Hanafi texts allow drawing back someone who understands the ruling, but in most masjids today it causes confusion, so it is better not to.
- Children: a child old enough to understand may form a row with you; see where children stand.
Women standing behind the men's rows alone, for example a single woman in a family congregation, is the sunnah position and is not makruh; see husband and wife praying together. On rows in general, see joining the prayer late.
The evidence
Sunan Abi Dawud 682
Grading to be checked... رأى رجلا يصلي خلف الصف وحده فأمره أن يعيد ...
"He saw a man praying alone behind the row and told him to repeat the prayer."
The basis of the Hanbali view, read by the other schools as a strong recommendation.
Sahih al-Bukhari 783
Sahih... زادك الله حرصا ولا تعد ...
"May Allah increase your keenness, but do not do it again."
Abu Bakrah prayed part of a rakah alone behind the row and was not told to repeat.
Where the ruling is recorded
- al-Durr al-Mukhtar, Kitab al-Salah, chapter on the imamate. Standing alone behind a row is makruh if there is space ahead; if full, he waits, and pulling someone back is not advised in our time.
- Kashshaf al-Qina', Kitab al-Salah, chapter on the position of the imam and followers. The Hanbali view that a full rakah alone behind the row invalidates the prayer.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.