The Prophet ﷺ offered the noon prayer in time of danger. Some of the people formed a row behind him and others arrayed themselves against the enemy. He led them in two rak'ahs and then he uttered the salutation. Then those who were with him went away and took the position of their companions before the enemy. Then they came and prayed behind him. He led them in two rak'ahs and uttered the salutation. Thus the Messenger of Allah ﷺ offered four rak'ahs and his companions offered two rak'ahs. Al-Hasan used to give legal verdict on the authority of this tradition. Abu Dawud said: This will be so in the sunset prayer. The imam will offer six rak'ahs and the people three rak'ahs. Abu Dawud said: Yahya b. Abi Kathir narrated from Abu Salamah from Jabir from the Prophet ﷺ something similar. Sulaiman al-Yashkuri reported it from the Prophet ﷺ in like manner.
صَلَّى النَّبِيُّ ﷺ فِي خَوْفٍ الظُّهْرَ فَصَفَّ بَعْضَهُمْ خَلْفَهُ وَبَعْضَهُمْ بِإِزَاءِ الْعَدُوِّ فَصَلَّى بِهِمْ رَكْعَتَيْنِ ثُمَّ سَلَّمَ فَانْطَلَقَ الَّذِينَ صَلَّوْا مَعَهُ فَوَقَفُوا مَوْقِفَ أَصْحَابِهِمْ ثُمَّ جَاءَ أُولَئِكَ فَصَلَّوْا خَلْفَهُ فَصَلَّى بِهِمْ رَكْعَتَيْنِ ثُمَّ سَلَّمَ فَكَانَتْ لِرَسُولِ اللَّهِ ﷺ أَرْبَعًا وَلأَصْحَابِهِ رَكْعَتَيْنِ رَكْعَتَيْنِ وَبِذَلِكَ كَانَ يُفْتِي الْحَسَنُ