كتاب الجهاد والسير
32  
The Book of Jihad and Expeditions
(23)
Chapter: Hastening to fight, and giving precedence to the more urgent of two tasks when a choice must be made
(23)
باب مَنْ لَزِمَهُ أَمْرٌ فَدَخَلَ عَلَيْهِ أَمْرٌ آخَرُ ‏‏
Sahih Muslim 1770

It has been narrated on the authority of Abdullah who said:

On the day he returned from the Battle of Ahzab, the Messenger of Allah (ﷺ) made for us an announcement that nobody would say his Zuhr prayer but in the quarters of Banu Quraiza (Some) people, being afraid that the time for prayer would expire, said their prayers before reaching the street of Banu Quraiza. The others said: We will not say our prayer except where the Messenger of Allah (ﷺ) has ordered us to say it even if the time expires. When he learned of the difference in the view of the two groups of the people, the Messenger of Allah (may peace be tipon him) did not blame anyone from the two groups.
وَحَدَّثَنِي عَبْدُ اللَّهِ بْنُ مُحَمَّدِ بْنِ أَسْمَاءَ الضُّبَعِيُّ، حَدَّثَنَا جُوَيْرِيَةُ بْنُ أَسْمَاءَ، عَنْ نَافِعٍ، عَنْ عَبْدِ اللَّهِ، قَالَ نَادَى فِينَا رَسُولُ اللَّهِ صلى الله عليه وسلم يَوْمَ انْصَرَفَ عَنِ الأَحْزَابِ ‏ "‏ أَنْ لاَ يُصَلِّيَنَّ أَحَدٌ الظُّهْرَ إِلاَّ فِي بَنِي قُرَيْظَةَ ‏"‏ ‏.‏ فَتَخَوَّفَ نَاسٌ فَوْتَ الْوَقْتِ فَصَلُّوا دُونَ بَنِي قُرَيْظَةَ ‏.‏ وَقَالَ آخَرُونَ لاَ نُصَلِّي إِلاَّ حَيْثُ أَمَرَنَا رَسُولُ اللَّهِ صلى الله عليه وسلم وَإِنْ فَاتَنَا الْوَقْتُ قَالَ فَمَا عَنَّفَ وَاحِدًا مِنَ الْفَرِيقَيْنِ ‏.‏
Reference : Sahih Muslim 1770
In-book reference : Book 32, Hadith 83
USC-MSA web (English) reference : Book 19, Hadith 4374
  (deprecated numbering scheme)