The Messenger of Allah ﷺ led the prayer of fear, performing one rakah with one of the two groups while the other group faced the enemy. Then that group withdrew and took the place of their companions, facing the enemy, and the others came forward. The Prophet ﷺ then prayed one rakah with them, after which the Prophet ﷺ gave the closing salutation. Then the first group completed their remaining rakah, and the second group completed their remaining rakah.
حدثنا عبد بن حميد أخبرنا عبد الرزاق أخبرنا معمر عن الزهري عن سالم
صلى رسول الله ﷺ صلاة الخوف بإحدى الطائفتين ركعة والطائفة الأخرى مواجهة العدو ثم انصرفوا وقاموا في مقام أصحابهم مقبلين على العدو وجاء أولئك ثم صلى بهم النبي ﷺ ركعة ثم سلم النبي ﷺ ثم قضى هؤلاء ركعة وهؤلاء ركعة