It is narrated from Jabir (may Allah be pleased with him) that at the place of Batn Nakhl (a settlement near Madinah), the Messenger of Allah (peace and blessings be upon him) led the people in the Zuhr prayer during a time of fear. He led one group in two rak‘ahs and then said salam. Then the second group came, and he led them in two rak‘ahs and then said salam.
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 368
Hadith Takhrijأخرجه النسائي: صلاة الخوف (1555) وصححه ابن خزيمة (1353).
Salih bin Khawwat (may Allah have mercy on him) narrated from a person who offered the prayer of fear with the Prophet ﷺ on the day of Dhat al-Riqa’. (That person stated) that one group formed rows with the Prophet ﷺ for prayer, and another group stood facing the enemy in rows. The Prophet ﷺ led those who stood with him in one rak‘ah, then he remained standing while they completed the rest of their prayer individually and left, going to stand in rows before the enemy. Then the second group came, and the Prophet ﷺ led them in the remaining rak‘ah and remained seated, while they completed the rest of their prayer during this time. Then the Prophet ﷺ said the salam with them.
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 369
Hadith Takhrijأخرجه البخاري: المغازي، باب غزوة ذات الرقاع (4129) ومسلم: صلاة المسافرين، باب صلاة الخوف (842).
From another chain of narration, Khawat bin Jubair narrates from the Prophet ﷺ a hadith with the same meaning as the previous one, which does not contradict the first.
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 370
Hadith Takhrijإسناده ضعيف لكن الحديث صحيح: انظر الحديث الذي تقدم قبله برقم (369) - أخرجه البيهقي في معرفة السنن والآثار (1828) وابن خزيمة (1360).