(describing the Fear prayer): The Imam stands up facing the Qibla and one batch of them (i.e. the army) (out of the two) prays along with him and the other batch faces the enemy. The Imam offers one rakʿa with the first batch they themselves stand up alone and offer one bowing and two prostrations while they are still in their place, and then go away to relieve the second batch, and the second batch comes (and takes the place of the first batch in the prayer behind the Imam) and he offers the second rakʿa with them. So he completes his two-rakʿat and then the second batch bows and prostrates two prostrations (i.e. complete their second rakʿa and thus all complete their prayer). (This hadith has also been narrated through two other chain by Sahl b. Abi Hathma)
يَقُومُ الإِمَامُ مُسْتَقْبِلَ الْقِبْلَةِ وَطَائِفَةٌ مِنْهُمْ مَعَهُ وَطَائِفَةٌ مِنْ قِبَلِ الْعَدُوِّ وُجُوهُهُمْ إِلَى الْعَدُوِّ فَيُصَلِّي بِالَّذِينَ مَعَهُ رَكْعَةً ثُمَّ يَقُومُونَ فَيَرْكَعُونَ لأَنْفُسِهِمْ رَكْعَةً وَيَسْجُدُونَ سَجْدَتَيْنِ فِي مَكَانِهِمْ ثُمَّ يَذْهَبُ هَؤُلاَءِ إِلَى مَقَامِ أُولَئِكَ فَيَرْكَعُ بِهِمْ رَكْعَةً فَلَهُ ثِنْتَانِ ثُمَّ يَرْكَعُونَ وَيَسْجُدُونَ سَجْدَتَيْنِ