"The Imam stands facing the Qiblah while a group of them stand with him, and a group is before the enemy, facing the enemy. He leads them in a Rak'ah, and they perform a bowing by themselves, and they perform two prostrations in their places. Then they go to take the position of the others and the others come (for prayers). He (the Imam) bows for one Rak'ah with them and performs two prostrations with them. That is two for him and one for them, then they perform one bowing and two prostrations."
The Book on Traveling
Jami' at-Tirmidhi - Hadith Reference: Jami` at-Tirmidhi 565
Hadith Text
"The Imam stands facing the Qiblah while a group of them stand with him, and a group is before the enemy, facing the enemy. He leads them in a Rak'ah, and they perform a bowing by themselves, and they perform two prostrations in their places. Then they go to take the position of the others and the others come (for prayers). He (the Imam) bows for one Rak'ah with them and performs two prostrations with them. That is two for him and one for them, then they perform one bowing and two prostrations."
Scholarly Commentary
This hadith elucidates the procedure of Salat al-Khawf (Prayer of Fear), which is prescribed during times of imminent danger in battle. The wisdom behind this prayer format is to maintain both worship and vigilance simultaneously.
The Imam remains stationary facing the Qiblah while dividing the congregation into two groups. The first group prays one rak'ah with the Imam, then completes their prayer independently while the second group remains guarding. This demonstrates the flexibility of Islamic jurisprudence in accommodating extreme circumstances.
The ruling is that the Imam performs two complete rak'ahs while each group performs one rak'ah with him and one independently. This arrangement ensures continuous military readiness while fulfilling the obligatory prayer in congregation to the extent possible.
This hadith establishes that during genuine fear, the normal prayer requirements may be modified to ensure safety while preserving the essence of worship. The scholars have derived from this that necessity dictates exceptions in Islamic law, provided the core obligations are maintained.