As Salamu Alaikum wa Rahmatullahi wa Barakatuhu
Ta'if Campaign:
Ta’if Campaign is in fact an extension of Hunain Ghazwah; that is because the majority of the defeated troops of Hawazin and Thaqif went into Ta’if with the general commander — Malik bin ‘Awf An-Nasri — and fortified themselves within it. So upon finishing with Hunain Invasion, he gathered the booty at Al-Ji‘ranah in the very month (i.e. Shawwal) and in the eighth year A.H.
A vanguard battalion of a thousand men led by Khalid bin Al-Waleed (Radhi Allahu Anhu) marched towards At-Ta’if. Whereas the Messenger of Allah (Sallallahu ‘Alayhi wa Sallam) proceeded passing through Nakhlah Al-Yamaniyah, Qarn Al-Manazil and through Laiyah. At Laiyah there was a castle that belonged to Malik bin ‘Awf, so the Messenger of Allah (Sallallahu ‘Alayhi wa Sallam) gave orders to have it destroyed. He resumed his march till he got to Ta’if. There he dismounted, camped near its castle and laid siege to the castle inhabitants; but not for long.
How long the siege continued, is still a matter of disagreement. It however stands between 10-20days. (Muslim)
A lot of arrow-shooting and rock-hurling occurred during the siege. For as soon as the Muslims laid siege round the castle, its people started shooting arrows against them. The arrows were so intense and fierce that they looked as if they had been locusts on the move. A number of Muslims were wounded and twelve were killed.
To be far from the arrow-range, the Muslims had to ascend to a higher location and camped on — i.e. to what is now called At-Ta’if Mosque. The Prophet (Sallallahu ‘Alayhi wa Sallam) set up a mangonel and shelled the castle. Eventually a gap was made in the castle wall, through which a number of Muslims managed to pass into the castle, sheltered by a wooden tank, with the purpose of setting fire into it.
Anyway, the enemy poured down molten hot iron on them. Affected by this the Muslims stepped out of the tank and were again exposed to arrow shooting and consequently some of them were killed.
To force the enemy to surrender, the Prophet (Sallallahu ‘Alayhi wa Sallam) tended to a war policy of burning and cutting the enemy’s crops. His order was to cut their vineyards and burn them. Seeing that the Muslims started rapidly cutting and burning their vines, they implored the Prophet (Sallallahu 'Alayhi wa Sallam) to stop and have mercy on them for the sake of Allah and out of kinship motives. So the Prophet (Sallallahu 'Alayhi wa Sallam) agreed. When the caller of the Messenger of Allah (Sallallahu ‘Alayhi wa Sallam) called out unto people saying “He whosoever descends and steps out of the castle is free.” Twenty-three men came out. (Al-Bukhari 2/620) One of them was Abu Bakrah who tied himself to a wall and let himself down by means of a small wheel, that would normally be used for drawing up water from a well. The way he let himself down made the Prophet nickname him “Abu Bakrah”, i.e. the man with the wheel. The Messenger of Allah (Sallallahu ‘Alayhi wa Sallam) set them all free and entrusted each one of them to a Muslim to care about their living affairs, which was too hard for the castle folks people to bear.
Seeing that the siege lasted too long and that the castle was immune and could stand any siege (for they had already stored a supply that suffices for over a year) and that the Muslims were suffering — day by day — from arrow-shots and heated iron hooks, the Messenger of Allah (Sallallahu 'Alayhi wa Sallam) consulted Nawfal bin Mu‘âwiyah Ad-Daili about that. He said: “They are like a fox hiding inside its burrow. If you stoodfast at it you would catch it, but if you parted with it, no harm would afflict you.” The Messenger of Allah (Sallallahu ‘Alayhi wa Sallam) decided to lift the siege and depart. ‘Umar bin Al-Khattab, (Radhi Allahu Anhu) who was ordered by the Prophet (Sallallahu 'Alayhi wa Sallam) to notify people, said to them “If Allah will, we are leaving the castle and going back tomorrow.” As it was too hard for the Muslims to go back and leave the castle unconquered they complained saying, “Should we go away while the castle is still unopened?”
His reply was: “Then, start fighting in the morning.” In the morning they fought and were wounded. So when he repeated this statement: “If Allah will, we are leaving the castle and going back tomorrow”, they were pleased and carried out the order submissively and started moving, which made the Messenger of Allah (Sallallahu ‘Alayhi wa Sallam) laugh.
As soon as they mounted and started moving the Messenger (Sallallahu ‘Alayhi wa Sallam) said:
“Say! Here we are returning, repenting, worshipping (Allah) and to our Lord we offer praise.”
When the Messenger of Allah was asked to invoke Allah against Thaqif, he said:
“O Allah, guide Thaqif and bring them to us as Muslims.”