The Prophet (ﷺ) besieged the people of Ta'if, but he did not conquer it. He said…

Sahih al-Bukhari Book 97 Hadith 106

Sahih al-Bukhari #7480

Oneness, Uniqueness of Allah (Tawheed) 97:106

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.

Chapter: (Allah’s) Wish and Will

Grade: Sahih