كتاب الجهاد والسير
32  
The Book of Jihad and Expeditions
(44)
Chapter: The Battle of Al-Ahzab (The Confederates), also known as Al-Khandaq (The Ditch)
(44)
باب غَزْوَةِ الأَحْزَابِ وَهِيَ الْخَنْدَقُ ‏‏
Sahih Muslim 1803 a

It has been reported on the authority of Barra' who said:

The Messenger of Allah (ﷺ) was carrying the earth with us on the Day of Ahzab and the whiteness of his belly had been covered with earth. (While engaged in this toil) he was reciting: By God, if Thou hadst not guided us We would have neither been guided aright nor practised charity, Nor offered prayers. Descend on us peace and tranquillity. Behold I these people (the Meccans) refused to follow us. According to another version, he recited: The chieftains (of the tribes) refused to follow us When they contemplated mischief, we rejected it. And with this (verse) he would raise his voice.
حَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، وَابْنُ، بَشَّارٍ - وَاللَّفْظُ لاِبْنِ الْمُثَنَّى - قَالاَ حَدَّثَنَا مُحَمَّدُ، بْنُ جَعْفَرٍ حَدَّثَنَا شُعْبَةُ، عَنْ أَبِي إِسْحَاقَ، قَالَ سَمِعْتُ الْبَرَاءَ، قَالَ كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم يَوْمَ الأَحْزَابِ يَنْقُلُ مَعَنَا التُّرَابَ وَلَقَدْ وَارَى التُّرَابُ بَيَاضَ بَطْنِهِ وَهُوَ يَقُولُ ‏"‏ وَاللَّهِ لَوْلاَ أَنْتَ مَا اهْتَدَيْنَا وَلاَ تَصَدَّقْنَا وَلاَ صَلَّيْنَا فَأَنْزِلَنْ سَكِينَةً عَلَيْنَا إِنَّ الأُلَى قَدْ أَبَوْا عَلَيْنَا ‏"‏ ‏.‏ قَالَ وَرُبَّمَا قَالَ ‏"‏ إِنَّ الْمَلاَ قَدْ أَبَوْا عَلَيْنَا إِذَا أَرَادُوا فِتْنَةً أَبَيْنَا ‏"‏ ‏.‏ وَيَرْفَعُ بِهَا صَوْتَهُ ‏.‏
Reference : Sahih Muslim 1803a
In-book reference : Book 32, Hadith 152
USC-MSA web (English) reference : Book 19, Hadith 4442
  (deprecated numbering scheme)