The Messenger of Allah ﷺ led his companions in the prayer of fear. One group prayed with him while another faced the enemy. He prayed two rakahs with the first group, then they took the position of the others, and the others came forward, and he prayed two rakahs with them, then he gave the salutation.
أخبرنا عمرو بن علي قال حدثنا عبد الأعلى قال حدثنا يونس عن الحسن قال
أن رسول الله ﷺ صلى بأصحابه صلاة الخوف فصلت طائفة معه وطائفة وجوههم قبل العدو فصلى بهم ركعتين ثم قاموا مقام الآخرين وجاء الآخرون فصلى بهم ركعتين ثم سلم
[Sahih] Ibn Khuzayma reported it from the hadith of Yunus bin Ubayd through the same chain, see the preceding hadith, 1553, and it is in Kubra, hadith 1942. Hasan did not state explicitly that he heard it, and it has a corroborating witness at hadith 843/312 and elsewhere.