Narrated Abdullah bin Omar: I took part in a holy battle with Allah’s Messenger, peace be upon him, in Najd. We faced the enemy and arranged ourselves in rows. Then Allah’s Messenger, peace be upon him, stood up to lead the Salat and one party stood to pray with him while the other faced the enemy. Allah’s Messenger, peace be upon him, and the former party bowed and performed two prostrations. Then that party left (after completing 2nd Rak’ah individu-ally with Taslim, while the Prophet, peace be upon him, kept on standing). Then they took the place of those who had not prayed.
(The second party joined) Allah’s Messenger, peace be upon him, who prayed one Rak’ah (i.e. his 2nd Rak’ah with the latter party) and performed two prostrations and finished his Salat with Taslim. Then every one of them (the 2nd party) bowed once and performed two pros-trations individually (i.e. completed their 2nd Rak’ah and finished their Salat with Taslim).
[2: 64- O.B. Sahih Al-Bukhari]
Narrated Nafi: Ibn Omar said in another quotation, “The Prophet, peace be upon him, said, ‘If the number of enemy is greater than the Muslims, they can offer Salat while standing or riding (individually)’.”
[2: 65- O.B. Sahih Al-Bukhari)
Narrated Sahl bin Abu Hathma: Concerning those who witnessed the Fear Prayer that was performed in the battle of Dhat-ur-Riqa in the company of Allah’s Messenger, peace be upon him; one batch lined up behind him while another batch (lined up) facing the enemy.
The Prophet, peace be upon him, led the batch that was with him in one Rak’ah, and he stayed in the standing posture while that batch completed their two (Rak’ah) prayer by themselves and went away, lining in the face of the enemy, while the other batch came. And he (i.e. the Prophet, peace be upon him,) offered his remaining Rak’ah with them, and then, kept on sitting till they completed their Salat by themselves, and he then finished his Salat with Taslim alongwith them.
(5: 451- O.B. Sahih Al-Bukhari)