We were with the Messenger of Allah ﷺ at Usfan, and Khalid bin Walid was leading the polytheists. We performed the noon prayer, and the polytheists said, "We missed an opportunity. We were caught off guard. Had we attacked them while they were in prayer..." So the verse on shortening the prayer was revealed between the noon and afternoon prayers.When the time for the afternoon prayer came, the Messenger of Allah ﷺ stood facing the qiblah, with the polytheists in front of him. One row formed behind the Messenger of Allah ﷺ, and another row formed behind that row. The Messenger of Allah ﷺ bowed, and they all bowed with him. Then he prostrated, and the row directly behind him prostrated, while the others remained standing to guard them. When those who had prostrated completed their two prostrations and stood up, the others who had been behind them then prostrated.Then the row that had been in front moved back to the position of the others, and the rear row advanced to the position of the front row. The Messenger of Allah ﷺ bowed, and they all bowed with him. Then he prostrated, and the row directly behind him prostrated, while the others remained standing to guard them. When the Messenger of Allah ﷺ sat, along with the row directly behind him, the others then prostrated, and they all sat together. He gave the salutation to all of them at once.He prayed in this manner at Usfan, and he also prayed in this manner on the day of Banu Sulaym.
حدثنا سعيد بن منصور حدثنا جرير بن عبد الحميد عن منصور عن مجاهد
كنا مع رسول الله ﷺ بعسفان وعلى المشركين خالد بن الوليد فصلينا الظهر فقال المشركون لقد أصبنا غرة لقد أصبنا غفلة لو كنا حملنا عليهم وهم في الصلاة فنزلت آية القصر بين الظهر والعصر فلما حضرت العصر قام رسول الله ﷺ مستقبل القبلة والمشركون أمامه فصف خلف رسول الله ﷺ صف وصف بعد ذلك الصف صف آخر فركع رسول الله ﷺ وركعوا جميعا ثم سجد وسجد الصف الذين يلونه وقام الآخرون يحرسونهم فلما صلى هؤلاء السجدتين وقاموا سجد الآخرون الذين كانوا خلفهم ثم تأخر الصف الذي يليه إلى مقام الآخرين وتقدم الصف الأخير إلى مقام الصف الأول ثم ركع رسول الله ﷺ وركعوا جميعا ثم سجد وسجد الصف الذي يليه وقام الآخرون يحرسونهم فلما جلس رسول الله ﷺ والصف الذي يليه سجد الآخرون ثم جلسوا جميعا فسلم عليهم جميعا فصلاها بعسفان وصلاها يوم بني سليم
Its isnad is sahih. Nasai reported it in the chapter on fear, section 1, no. 1551, from the hadith of Mansur through this route. Bayhaqi graded it sahih (3/257), as did Baghawi (Sharh al-Sunnah, 1096), Daraqutni (2/60), and Ibn Hibban (587, 588). Hakim (1/337, 338) said it meets the criteria of the two Shaykhs (Bukhari and Muslim), and Dhahabi agreed with him.