Abdullah bin Umar reported,

The Prophet ﷺ said to us when he returned from the Battle of the Confederates, "No one is to pray the afternoon prayer except in the territory of Banu Qurayzah."The time for the afternoon prayer caught some of them while they were still on the way.Some of them said, "We will not pray until we reach there."Others said, "Rather, we will pray, for that is not what he intended for us."This was mentioned to the Prophet ﷺ, and he did not rebuke either group.

Bukhari 946

Sahih

حدثنا عبد الله بن محمد بن أسماء قال حدثنا جويرية عن نافع

عن ابن عمر قال

قال النبي ﷺ لنا لما رجع من الأحزاب لا يصلين أحد العصر إلا في بني قريظة فأدرك بعضهم العصر في الطريق فقال بعضهم لا نصلي حتى نأتيها وقال بعضهم بل نصلي لم يرد منا ذلك فذكر للنبي ﷺ فلم يعنف واحدا منهم

البخاري 946صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Prayer of fear
Chapter
Prayer of the pursuer and the pursued while riding, with gestures
Numbering
Darussalam 946
Bukhari 946