Salim bin Abdullah bin Umar (may Allah have mercy on him) narrates from his father (Sayyiduna Abdullah bin Umar (may Allah be pleased with them both)) that the Prophet (peace and blessings be upon him) led one of the two groups in one rak'ah while the other group was facing the enemy. Then they left and stood in the others' place. Then the other group came, and he (peace and blessings be upon him) led them in one rak'ah. Then he (peace and blessings be upon him) gave the salam. Then these stood up and completed their rak'ah, and the others completed their rak'ah.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب صلاة الخوف / 6040