Sulaym bin Ubayd al-Saluli (may Allah have mercy on him) said: I was with Sayyiduna Sa'id bin al-As (may Allah be pleased with him) in Tabaristan, and with him was a group of the Companions of the Prophet (peace and blessings be upon him). Sayyiduna Sa'id (may Allah be pleased with him) asked them: "Which of you was present with the Prophet (peace and blessings be upon him) at the fear prayer (salat al-khawf)?" Sayyiduna Hudhayfah (may Allah be pleased with him) said: "I (was present). Order your companions to divide into groups: one group facing the enemy and another group behind you. You say the takbir and they all say the takbir; you bow and they all bow; and when you raise your head from bowing, they all raise their heads from bowing. Then you prostrate, and the group that is with you prostrates as well while the other group remains standing facing the enemy. When you raise your head, those who are next to you stand up and the other group prostrates. Then you bow and they all bow. Then you raise your head and they all raise their heads. When you prostrate, the group next to you prostrates while the other group remains standing facing the enemy. When you raise your head from prostration, those who were standing facing the enemy prostrate. Then you give the salam, and order your companions that if fighting flares up, then fighting and speaking become permissible for them."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخوف / 6006