The battle was joined at Hunayn, a valley between Makka and Ta'if. The new Muslims had more enthusiasm than wisdom, more a spirit of elation than of faith and confidence in the righteousness of their cause. The enemy had the advantage of knowing the ground thoroughly. They laid an ambush in which the Muslims' advance guard was caught or intentionally pushed by the Messenger, who might have planned to draw the enemy in under the guise of retreat. However, the retreat was confused and took place under a shower of enemy arrows. The Prophet, calm as ever in his faith and wisdom in that hour of danger, spurred his horse forward. His uncle 'Abbas was on his right, and his uncle's son Fadl was on his left. While Abu Sufyan ibn al-Harith was trying to stop him, the Messenger was shouting: "Now war has been kindled. I am the Prophet, that is no lie. I am the descendant of 'Abd al-Muttalib." 
'Abbas shouted: "Companions who made the pledge of allegiance under the acacia tree!"  From all sides came the response: "Labbayk! (at your service!)," and they rallied to the Prophet. The enemy, now in the center of the Muslim army, was surrounded on all sides. The Messenger's courage, wisdom, and steadfastness changed a seeming defeat into a decisive victory. It was by God's help that the Muslims won the day. They completed the victory with an energetic pursuit of the enemy, capturing their camps, flocks and herds, and families, which they had boastfully brought with them in expectation of an easy victory.
The routed enemy took refuge in Ta'if. The Muslims' victory persuaded the desert tribes to accept Islam, and shortly thereafter the rebel tribes and Ta'if also surrendered and entered Islam.
 Ibn Kathir, 4:373.