The Messenger of Allah ﷺ laid siege to the people of Taif but gained nothing from them, so he said, "We shall be departing, Allah willing."His companions said, "Are we to leave without conquering it?"The Messenger of Allah ﷺ told them, "Set out tomorrow for battle." So they went out the next day to fight, and they suffered wounds.Then the Messenger of Allah ﷺ said to them, "We shall be departing tomorrow." This pleased them, and the Messenger of Allah ﷺ laughed.
حاصر رسول الله ﷺ أهل الطائف فلم ينل منهم شيئا، فقال: إنا قافلون إن شاء الله قال أصحابه: نرجع ولا نفتتحه؟ فقال لهم رسول الله ﷺ: اغدوا على القتال فغدوا عليه فأصابهم جراح، فقال لهم رسول الله ﷺ: إنا قافلون غدا قال: فأعجبهم ذلك، فضحك رسول الله ﷺ.
Bukhari narrated it in the Book of Military Expeditions (4325), and Muslim narrated it in the Book of Jihad and Expeditions (1778: 82), both of them through the route of Sufyan bin Uyayna, from Amr (who is Ibn Dinar), from Abu Abbas the blind poet, from Abdullah bin Amr, who said, and then he mentioned it. It has been said that this hadith belongs to the musnad of Abdullah bin Umar bin Khattab, but the correct view is that it belongs to Abdullah bin Amr bin As.