Language:
كتاب التوحيد
97  
Oneness, Uniqueness of Allah (Tawheed)
(31)
Chapter: (Allah’s) Wish and Will
(31)
باب فِي الْمَشِيئَةِ وَالإِرَادَةِ
Sahih al-Bukhari 7480

Narrated `Abdullah bin `Umar:

The Prophet (ﷺ) besieged the people of Ta'if, but he did not conquer it. He said, "Tomorrow, if Allah will, we will return home. On this the Muslims said, "Then we return without conquering it?" He said, 'Then carry on fighting tomorrow." The next day many of them were injured. The Prophet (ﷺ) said, "If Allah will, we will return home tomorrow." It seemed that statement pleased them whereupon Allah's Apostle smiled.

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ، حَدَّثَنَا ابْنُ عُيَيْنَةَ، عَنْ عَمْرٍو، عَنْ أَبِي الْعَبَّاسِ، عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ، قَالَ حَاصَرَ النَّبِيُّ صلى الله عليه وسلم أَهْلَ الطَّائِفِ فَلَمْ يَفْتَحْهَا فَقَالَ ‏"‏ إِنَّا قَافِلُونَ إِنْ شَاءَ اللَّهُ ‏"‏‏.‏ فَقَالَ الْمُسْلِمُونَ نَقْفُلُ وَلَمْ نَفْتَحْ‏.‏ قَالَ ‏"‏ فَاغْدُوا عَلَى الْقِتَالِ ‏"‏‏.‏ فَغَدَوْا فَأَصَابَتْهُمْ جِرَاحَاتٌ‏.‏ قَالَ النَّبِيُّ صلى الله عليه وسلم ‏"‏ إِنَّا قَافِلُونَ غَدًا إِنْ شَاءَ اللَّهُ ‏"‏، فَكَأَنَّ ذَلِكَ أَعْجَبَهُمْ فَتَبَسَّمَ رَسُولُ اللَّهِ صلى الله عليه وسلم‏.‏
Reference : Sahih al-Bukhari 7480
In-book reference : Book 97, Hadith 106
USC-MSA web (English) reference : Vol. 9, Book 93, Hadith 572
  (deprecated numbering scheme)