Sahih Muslim , Book 19, Hadith 4393 (USC-MSA) ⓘ
It has been narrated on the authority of Ibn 'Amr who said: The Messenger of Allah besieged the people of Ta'if, but did get victory over them. He said: God willing, we shall return. His Companions said: Shall we depart without having conquered it? The Messenger of Allah said: (All right) make a raid in the morning. They did so. and were wounded (with the arrows showered upon them). So the Messenger of Allah said: We shall depart tomorrow. (The narrator says): (Now) this (announcement) pleased them, and the Messenger of Allah laughed at (their waywardness).
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَزُهَيْرُ بْنُ حَرْبٍ، وَابْنُ، نُمَيْرٍ جَمِيعًا عَنْ سُفْيَانَ، قَالَ زُهَيْرٌ حَدَّثَنَا سُفْيَانُ بْنُ عُيَيْنَةَ، عَنْ عَمْرٍو، عَنْ أَبِي الْعَبَّاسِ الشَّاعِرِ الأَعْمَى، عَنْ عَبْدِ اللَّهِ، بْنِ عَمْرٍو قَالَ حَاصَرَ رَسُولُ اللَّهِ صلى الله عليه وسلم أَهْلَ الطَّائِفِ فَلَمْ يَنَلْ مِنْهُمْ شَيْئًا فَقَالَ " إِنَّا قَافِلُونَ إِنْ شَاءَ اللَّهُ " . قَالَ أَصْحَابُهُ نَرْجِعُ وَلَمْ نَفْتَتِحْهُ فَقَالَ لَهُمْ رَسُولُ اللَّهِ صلى الله عليه وسلم " اغْدُوا عَلَى الْقِتَالِ " . فَغَدَوْا عَلَيْهِ فَأَصَابَهُمْ جِرَاحٌ فَقَالَ لَهُمْ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِنَّا قَافِلُونَ غَدًا " . قَالَ فَأَعْجَبَهُمْ ذَلِكَ فَضَحِكَ رَسُولُ اللَّهِ صلى الله عليه وسلم .
also referenced under: Book 32, Hadith 102 (In-Book) & Hadith 1778 (Reference)