Someone who prayed with the Messenger of Allah ﷺ on the Day of Dhat al-Riqa, performing the prayer of fear, reported that one group lined up with him while another group faced the enemy. He led those with him in one rakah, then remained standing while they completed their prayer on their own. They then withdrew and took up position facing the enemy.The other group came forward, and he led them in the remaining rakah of his prayer, then remained sitting while they completed their prayer on their own. He then concluded the prayer with them by giving the salam.
أخبرنا قتيبة عن مالك عن يزيد بن رومان
عمن صلى مع رسول الله ﷺ يوم ذات الرقاع صلاة الخوف أن طائفة صفت معه وطائفة وجاه العدو فصلى بالذين معه ركعة ثم ثبت قائما وأتموا لأنفسهم ثم انصرفوا فصفوا وجاه العدو وجاءت الطائفة الأخرى فصلى بهم الركعة التي بقيت من صلاته ثم ثبت جالسا وأتموا لأنفسهم ثم سلم بهم
Bukhari transmitted it, no. 4129, from Qutayba, and Muslim, no. 842 (see the previous hadith), from the narration of Malik through this chain, and it is in Muwatta (Yahya): 1/183, and Kubra, no. 1925.