Did you pray in time of danger with the Messenger of Allah ﷺ? AbuHurayrah replied: Yes. Marwan then asked: When? AbuHurayrah said: On the occasion of the Battle of Najd. The Messenger of Allah ﷺ stood up to offer the afternoon prayer. One section stood with him (to pray) and the other was standing before the enemy, and their backs were towards the qiblah. The Messenger of Allah ﷺ uttered the takbir and all of them too uttered the takbir, i.e. those who were with him and those who were facing the enemy. Then the Messenger of Allah ﷺ offered one rak'ah and the section that was with him also prayed one rak'ah. He then prostrated himself and those who were with him also prostrated, while the other section was standing before the enemy. The Messenger of Allah ﷺ then stood up and the section with him also stood up. They went and faced the enemy and the section that was previously facing the enemy stepped forward. They bowed and prostrated while the Messenger of Allah ﷺ was standing in the same position. Then they stood up and the Messenger of Allah (may peace be upon) prayed another rak'ah and all of them bowed and prostrated along with him. After that the section that was standing before the enemy came forward and they bowed and prostrated, while the Messenger of Allah ﷺ remained seated and also those who were with him. The salutation then followed. The Messenger of Allah ﷺ uttered the salutation and all of them uttered it together. The Messenger of Allah ﷺ prayed two rak'ahs and each of the two sections prayed one rak'ah with him (and the other by themselves).
أَنَّهُ سَأَلَ أَبَا هُرَيْرَةَ هَلْ صَلَّيْتَ مَعَ رَسُولِ اللَّهِ ﷺ صَلاَةَ الْخَوْفِ قَالَ أَبُو هُرَيْرَةَ نَعَمْ قَالَ مَرْوَانُ مَتَى فَقَالَ أَبُو هُرَيْرَةَ عَامَ غَزْوَةِ نَجْدٍ قَامَ رَسُولُ اللَّهِ ﷺ إِلَى صَلاَةِ الْعَصْرِ فَقَامَتْ مَعَهُ طَائِفَةٌ وَطَائِفَةٌ أُخْرَى مُقَابِلَ الْعَدُوِّ ظُهُورُهُمْ إِلَى الْقِبْلَةِ فَكَبَّرَ رَسُولُ اللَّهِ ﷺ فَكَبَّرُوا جَمِيعًا الَّذِينَ مَعَهُ وَالَّذِينَ مُقَابِلِي الْعَدُوِّ ثُمَّ رَكَعَ رَسُولُ اللَّهِ ﷺ رَكْعَةً وَاحِدَةً وَرَكَعَتِ الطَّائِفَةُ الَّتِي مَعَهُ ثُمَّ سَجَدَ فَسَجَدَتِ الطَّائِفَةُ الَّتِي تَلِيهِ وَالآخَرُونَ قِيَامٌ مُقَابِلِي الْعَدُوِّ ثُمَّ قَامَ رَسُولُ اللَّهِ ﷺ وَقَامَتِ الطَّائِفَةُ الَّتِي مَعَهُ فَذَهَبُوا إِلَى الْعَدُوِّ فَقَابَلُوهُمْ وَأَقْبَلَتِ الطَّائِفَةُ الَّتِي كَانَتْ مُقَابِلِي الْعَدُوِّ فَرَكَعُوا وَسَجَدُوا وَرَسُولُ اللَّهِ ﷺ قَائِمٌ كَمَا هُوَ ثُمَّ قَامُوا فَرَكَعَ رَسُولُ اللَّهِ ﷺ رَكْعَةً أُخْرَى وَرَكَعُوا مَعَهُ وَسَجَدَ وَسَجَدُوا مَعَهُ ثُمَّ أَقْبَلَتِ الطَّائِفَةُ الَّتِي كَانَتْ مُقَابِلِي الْعَدُوِّ فَرَكَعُوا وَسَجَدُوا وَرَسُولُ اللَّهِ ﷺ قَاعِدٌ وَمَنْ مَعَهُ ثُمَّ كَانَ السَّلاَمُ فَسَلَّمَ رَسُولُ اللَّهِ ﷺ وَسَلَّمُوا جَمِيعًا فَكَانَ لِرَسُولِ اللَّهِ ﷺ رَكْعَتَانِ وَلِكُلِّ رَجُلٍ مِنَ الطَّائِفَتَيْنِ رَكْعَةٌ رَكْعَةٌ