Sunan Abi Dawud Book 4, Hadith 40
The Prophet (ﷺ) prayed in time of danger and divided them (the people) behind him in two rows. He then led those who were near him in one rak'ah. Then he stood and remained standing till those who were in second row offered one rak'ah. Thereafter they came forward and those who were in front of them (in the first row) stepped backward. The Prophet (ﷺ) led them in one rak'ah of prayer. He sat down till those who were in the second row completed on rak'ah. He then uttered the salutation.
We accompanied the Messenger of Allah (ﷺ) at Usfan, and Khalid ibn al-Walid was the chief of unbelievers. We offered the noon prayer.
Thereupon, the unbelievers said: We suffered from negligence; we became careless. We should have attacked them while they were praying. Thereupon the verse was revealed, relating to the shortening of the prayer (in time of danger) between the noon and afternoon (prayer).
When the time of the afternoon prayer came, the Messenger of Allah (ﷺ) stood facing the qiblah, and the unbelievers were standing in front of him. The people stood in a row behind the Messenger of Allah (ﷺ) and there was another row behind this row. The Messenger of Allah (ﷺ) bowed and all of them bowed. He then prostrated and also the row near him prostrated. The other people in the second row remained standing and stood guard over them. When they performed two prostrations and stood up, those who were behind them prostrated. The people in the front row near him then stepped backward taking the place of the people in the second row and the second row took the place of the first row.
The Messenger of Allah (ﷺ) then bowed and all of them bowed together. Then he and the row near him prostrated themselves. The other people in the second row remained standing and stood guard over them. When the Messenger of Allah (ﷺ) and the row near him (i.e. the front row) were seated, the people in the second row behind them prostrated themselves. Then all of them were seated. (He (the Prophet) then uttered the salutation upon all of them. He prayed in his manner at Usfan as well as at the territory of Banu Sulaym.
Abu Dawud said: This tradition has been narrated by Ayyub and Hisham from Abu al-Zubair on the authority of Jabir to the same effect from the Prophet (ﷺ). Similarly, this has been transmitted by Dawud b. Husain from 'Ikrimah, on the authority of Ibn 'Abbas. This has also been reported by 'Abd al-Malik, from 'Ata' from Jabir in like manner. This has also been narrated by Qatadah from al-Hasan from Hittan on the authority of Abu Musa in a similar way. Similarly, this has been reported by 'Ikrimah b. Khalid from Mujahid from the Prophet (ﷺ). This has also been reported by Hisham b. 'Urwah from his father from the Prophet (ﷺ). This is the opinion of al-Thawri.
On the authority of a person who offered the prayer in time of danger along with the Messenger of Allah (ﷺ) at the battle of Dhat al-Riqa. One section of people stood in the row of prayer along with the Messenger of Allah (ﷺ) and the other section remained standing in front of the enemy. He led those who were with him in one rak'ah and remained standing (in his place) and they completed (the second rak'ah) by themselves. Then they turned away and arrayed before the enemy. Thereafter the other section came and he led them in the rak'ah which remained from his prayer. He then remained sitting (in his place) and they completed their one rak'ah by themselves. He then uttered the salutation along with them.
Malik said: I like the tradition reported by Yazid b. Ruman (i.e. the present tradition) more than (other versions) I heard.