"The Prophet prayed Salat Al-Khawf, praying one Rak'ah with one of the two groups, while the other group was facing the enemy. (When the first group finished they first Rak'ah with him), they went and took position (of the second group, facing the enemy). Then the second group came and he led them in another Rak'ah, then he said the Taslim to them, while the group proceeded to complete their (second) Rak'ah. Thereafter, the first group stood up to finish their (second) Rak'ah."
أَنَّ النَّبِيَّ ﷺ صَلَّى صَلاَةَ الْخَوْفِ بِإِحْدَى الطَّائِفَتَيْنِ رَكْعَةً وَالطَّائِفَةُ الأُخْرَى مُوَاجِهَةُ الْعَدُوِّ ثُمَّ انْصَرَفُوا فَقَامُوا فِي مَقَامِ أُولَئِكَ وَجَاءَ أُولَئِكَ فَصَلَّى بِهِمْ رَكْعَةً أُخْرَى ثُمَّ سَلَّمَ عَلَيْهِمْ فَقَامَ هَؤُلاَءِ فَقَضَوْا رَكْعَتَهُمْ وَقَامَ هَؤُلاَءِ فَقَضَوْا رَكْعَتَهُمْ