حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُعَاذٍ، حَدَّثَنَا أَبِي، حَدَّثَنَا شُعْبَةُ، عَنْ عَبْدِ الرَّحْمَنِ بْنِ الْقَاسِمِ، عَنْ أَبِيهِ، عَنْ صَالِحِ بْنِ خَوَّاتٍ، عَنْ سَهْلِ بْنِ أَبِي حَثْمَةَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم صَلَّى بِأَصْحَابِهِ فِي خَوْفٍ فَجَعَلَهُمْ خَلْفَهُ صَفَّيْنِ فَصَلَّى بِالَّذِينَ يَلُونَهُ رَكْعَةً ثُمَّ قَامَ فَلَمْ يَزَلْ قَائِمًا حَتَّى صَلَّى الَّذِينَ خَلْفَهُمْ رَكْعَةً ثُمَّ تَقَدَّمُوا وَتَأَخَّرَ الَّذِينَ كَانُوا قُدَّامَهُمْ فَصَلَّى بِهِمُ النَّبِيُّ صلى الله عليه وسلم رَكْعَةً ثُمَّ قَعَدَ حَتَّى صَلَّى الَّذِينَ تَخَلَّفُوا رَكْعَةً ثُمَّ سَلَّمَ ‏.‏
Translation
Narrated Sahl b. Abi Hathmah

The Prophet (ﷺ) prayed in time of danger and divided them (the people) behind him in two rows. He then led those who were near him in one rak'ah. Then he stood and remained standing till those who were in second row offered one rak'ah. Thereafter they came forward and those who were in front of them (in the first row) stepped backward. The Prophet (ﷺ) led them in one rak'ah of prayer. He sat down till those who were in the second row completed on rak'ah. He then uttered the salutation.

Comment

Prayer of Danger (Salat al-Khawf)

This narration from Sunan Abi Dawud 1237 describes the Prophet's method of performing the prayer during times of imminent danger, particularly in battlefield situations.

Methodology and Wisdom

The Prophet divided the congregation into two rows: one facing the enemy as guards while the other prayed. This ensured continuous protection during worship.

The first row prayed one rak'ah with the Imam, then remained standing in prayer posture while the second row completed their first rak'ah independently.

Rotation System

After completing their prayer, the second row moved forward to face the enemy while the first row stepped back to complete their second rak'ah with the Imam.

This rotation system maintained constant vigilance while fulfilling the obligation of congregational prayer.

Legal Rulings

This prayer format is prescribed when the Muslim army faces immediate threat from enemy forces during prayer times.

The Imam leads both groups in a total of two rak'ahs, with each group completing one rak'ah independently and one with the Imam.

The prayer remains valid even with this modified format, demonstrating Islam's practical accommodation of necessity.