Sayyiduna Jabir bin Abdullah (may Allah be pleased with them both) said that the Messenger of Allah (peace and blessings be upon him) led his Companions in prayer: one group prayed with him (peace and blessings be upon him) while the other group was facing the enemy. He (peace and blessings be upon him) led them in two rak'ahs; then they went and stood facing the enemy. The others came, and he (peace and blessings be upon him) led them in two rak'ahs and gave the salam.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخوف / 6034