Sahl bin Abu Hathma related that the prayer in a situation of danger is performed this way. The imam stands with one group of his companions, while another group faces the enemy. The imam bows for one rakat and prostrates along with those who are with him. Then he rises, and once he is standing upright he remains standing while they complete the remaining rakat for themselves. Then they say the closing salutation and withdraw, with the imam still standing, and they take up position facing the enemy. Then the others, who have not yet prayed, come forward and say the opening takbir behind the imam. He bows with them for that rakat and prostrates, then he says the closing salutation. They then stand and bow for the remaining rakat by themselves, and then they say the closing salutation.
و حدثني عن مالك عن يحيى بن سعيد عن القاسم بن محمد
أن سهل بن أبي حثمة حدثه أن صلاة الخوف أن يقوم الإمام ومعه طائفة من أصحابه وطائفة مواجهة العدو فيركع الإمام ركعة ويسجد بالذين معه ثم يقوم فإذا استوى قائما ثبت وأتموا لأنفسهم الركعة الباقية ثم يسلمون وينصرفون والإمام قائم فيكونون وجاه العدو ثم يقبل الآخرون الذين لم يصلوا فيكبرون وراء الإمام فيركع بهم الركعة ويسجد ثم يسلم فيقومون فيركعون لأنفسهم الركعة الباقية ثم يسلمون