It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that eighty men of Makkah came down upon the Messenger of Allah (peace and blessings be upon him) and his Companions from the mountain of al-Tan'im at the time of the Fajr prayer in order to kill him. The Messenger of Allah (peace and blessings be upon him) seized them and took them captive, then set them free. So Allah Almighty revealed this verse: "And it is He who restrained their hands from you and your hands from them" [Surah al-Fath: 24].
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قسم الفيء والغنيمة / 12832