Salih bin Khawat reported,

Someone who prayed the prayer of fear with the Messenger of Allah ﷺ on the day of Dhat ar-Riqa reported that one group lined up behind him while another group faced the enemy. He prayed one cycle with the group that was with him, then remained standing while they completed the prayer for themselves. They then withdrew and took up position facing the enemy. The other group came forward, and he prayed with them the remaining cycle of his prayer, then remained seated while they completed the prayer for themselves. He then concluded the prayer with them by giving the salam.Malik said, "The hadith of Yazid bin Ruman is the most preferable account I have heard on this matter."

Abu Dawud 1238

Sahih

حدثنا القعنبي عن مالك عن يزيد بن رومان

عن صالح بن خوات

عمن صلى مع رسول الله ﷺ يوم ذات الرقاع صلاة الخوف أن طائفة صفت معه وطائفة وجاه العدو فصلى بالتي معه ركعة ثم ثبت قائما وأتموا لأنفسهم ثم انصرفوا وصفوا وجاه العدو وجاءت الطائفة الأخرى فصلى بهم الركعة التي بقيت من صلاته ثم ثبت جالسا وأتموا لأنفسهم ثم سلم بهم قال مالك وحديث يزيد بن رومان أحب ما سمعت إلي

أبو داود 1238صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Prayer while traveling
Chapter
Those who said that if he prays one rakat and remains standing, they complete one rakat for themselves then give the salam then move away and face the enemy, and the difference of opinion regarding the salam
Numbering
Darussalam 1238
Abu Dawud 1238