Although the Battle of Hunayn was won by the Muslims, those who fled from the battle and joined forces with other tribes hostile to Islam began to pose a new threat. At their head were the people of Ta’if. The people of Ta’if periodically demonstrated their hostility towards Islam to the point of impudence and effrontery. When the poets satirizing Prophet Muhammad and the Muslims, as well those working against Islam ran into trouble, they fled to Ta’if and sought refuge there. For this reason, Ta’if became somewhat a safe house for the enemy. Hence, the Hawazin who were defeated at Awtas also sought shelter here. Immediately after the Battle of Hunayn, Prophet Muhammad decided to advance upon Ta’if with an army that he himself led. Reaching Ta’if after the advance guard of 1,000 men under the command of Khalid ibn Walid, the Prophet besieged the Thaqif and other branches of the Hawazin who had taken shelter in fortresses therein, for almost a month. As the people of Ta’if were in their fortresses, they were able to mount a strong defense, subjecting the Muslims launching an offensive out in the open to a heavy barrage of arrows. In this siege wherein various strategy and tactics were employed, the Muslims made use of military equipment such as catapults and trebuchets. Upon realizing that the people of Ta’if had stockpiled one year’s worth of food supplies, and with the approach of the sacred months the Prophet lifted the siege and came to Ji'rana, where the war spoils were gathered. It is reported that twelve Muslims were martyred and three enemy fighters killed D-during the siege of Ta’if.
After Ta’if, Prophet Muhammad returned to Ji'rana, where the prisoners of war and goods seized during battle were amassed. The prisoners numbered 6,000, including women and children. Among the spoils were more than 24,000 camels and 40,000 sheep, as well as 4,000 ounces of silver. Ordering that prisoners who were in need of clothing be dressed, Prophet Muhammad did not distribute the spoils right away, but waited. His intention was to return these goods to the Muslim members of the Hawazin who appealed to him. However, when the Hawazin delegation were delayed some of the hypocrites together with a number of Bedouin newcomers to Islam who had not yet acquired sincere belief and commitment exerted great pressure, and maliciously so, on the Prophet to distribute the war spoils without delay.
After reserving one-fifth of the spoils (known as khumus) for the Public Treasury (bayt al-mal), Prophet Muhammad distributed the remaining prisoners and goods. He gave those members of the Quraysh who were given a grace period of four months after the conquest of Makka and referred to as muallafa al-qulub (those whose hearts were gained over) in the sources greater shares so as to reconcile their hearts and increase their commitment to Islam. After the distribution of the spoils, a delegation from the Hawazin, declaring their acceptance of Islam, requested the return of their prisoners and goods. Reminding them that he had waited for them for some time prior to the distribution, Prophet Muhammad told them that it would be difficult to fulfill their requests at this stage and asked them to make a choice between their prisoners and goods. When they chose their prisoners, the Prophet fulfilled their request, having also obtained the consent of his Companions. Although some among the Muslim Bedouins did not wish to give up their prisoners, the Prophet persuaded them to do so with the promise of greater shares at the first opportunity to arise. In the meantime, the Prophet’s granting more shares to the muallafa al-qulub gave rise to claims of favoritism to the Quraysh and even rumors that he was to stay in Makka and abandon the Ansar, the natives of Madina. Gathering the Ansar as a result, Prophet Muhammad explained to them the reason behind his granting greater shares to the muallafa al-qulub, and stressing the virtues of the Ansar declared that he would forever be with them, and made supplication for them and their descendants. Experiencing great remorse after his speech, the Ansar expressed their sadness and declared their contentment with him.
After the distribution of the spoils and having stayed in Ji'rana for a fortnight, Prophet Muhammad entered the state of ihram (pilgrim dress) and set off for Makka. He returned to Madina after completing the ‘Umra, or minor pilgrimage.
Prophet Muhammad entrusted the household and possessions of the commander of the Hawazin forces Malik ibn ‘Awf – forced to flee to Ta’if after the defeat at Hunayn – to Umm ‘Abd Allah bint Umayya; sending word to Malik, the Prophet announced that in the event of his becoming Muslim, his family and possessions would be returned to him, together with 100 camels. When Malik ibn ‘Awf subsequently came to the Prophet and embraced Islam, he was given all that he was promised. Including Malik ibn ‘Awf among the muallafa al-qulub, Prophet Muhammad appointed him governor to his own tribe and to those that resided in Ta’if and in its surrounds. Malik ibn ‘Awf had a significant role in the Thaqif’s coming to Madina in the ninth year after the Emigration (631) and embracing Islam.