Sahih al-Bukhari, Hadith 942

Narrated Shu'aib: I asked Az-Zuhri, "Did the Prophet ever offer the Fear Prayer?" Az-Zuhri said, "I was told by Salim that `Abdullah bin `Umar I had said, 'I took part in a holy battle with Allah's Messenger I in Najd. We faced the enemy and arranged ourselves in rows. Then Allah's Messenger (p.b.u.h) stood up to lead the prayer and one party stood to pray with him while the other faced the enemy. Allah's Messenger (p.b.u.h) and the former party bowed and performed two prostrations. Then that party left and took the place of those who had not prayed. Allah's Messenger prayed one rak`a (with the latter) and performed two prostrations and finished his prayer with Taslim. Then everyone of them bowed once and performed two prostrations individually.' "

حَدَّثَنَا أَبُو الْيَمَانِ، قَالَ أَخْبَرَنَا شُعَيْبٌ، عَنِ الزُّهْرِيِّ، قَالَ سَأَلْتُهُ هَلْ صَلَّى النَّبِيُّ صلى الله عليه وسلم يَعْنِي صَلاَةَ الْخَوْفِ قَالَ أَخْبَرَنِي سَالِمٌ أَنَّ عَبْدَ اللَّهِ بْنَ عُمَرَ ـ رضى الله عنهما ـ قَالَ غَزَوْتُ مَعَ رَسُولِ اللَّهِ صلى الله عليه وسلم قِبَلَ نَجْدٍ، فَوَازَيْنَا الْعَدُوَّ فَصَافَفْنَا لَهُمْ فَقَامَ رَسُولُ اللَّهِ صلى الله عليه وسلم يُصَلِّي لَنَا فَقَامَتْ طَائِفَةٌ مَعَهُ تُصَلِّي، وَأَقْبَلَتْ طَائِفَةٌ عَلَى الْعَدُوِّ وَرَكَعَ رَسُولُ اللَّهِ صلى الله عليه وسلم بِمَنْ مَعَهُ، وَسَجَدَ سَجْدَتَيْنِ، ثُمَّ انْصَرَفُوا مَكَانَ الطَّائِفَةِ الَّتِي لَمْ تُصَلِّ، فَجَاءُوا، فَرَكَعَ رَسُولُ اللَّهِ صلى الله عليه وسلم بِهِمْ رَكْعَةً، وَسَجَدَ سَجْدَتَيْنِ ثُمَّ سَلَّمَ، فَقَامَ كُلُّ وَاحِدٍ مِنْهُمْ فَرَكَعَ لِنَفْسِهِ رَكْعَةً وَسَجَدَ سَجْدَتَيْنِ‏.‏

sunnah.com