Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: When the Messenger of Allah (peace and blessings be upon him) stood over Hamzah (may Allah be pleased with him) and saw his condition, he said: "Were it not that the women would grieve, I would not have covered him like this; I would have left him until he was in the bellies of the beasts of prey and the crops of the birds, until Allah resurrects him from there." The narrator said: He (peace and blessings be upon him) was deeply grieved by the condition he saw him in, and he (peace and blessings be upon him) said: "If I gain victory over Quraysh, I will surely mutilate (muthlah) thirty of their men." So Allah, the Mighty and Majestic, revealed concerning that: "And if you retaliate, then retaliate with the like of that with which you were harmed" [al-Nahl: 126] up to "what they plot" [al-Nahl: 127]. Then he (peace and blessings be upon him) gave the order, and he was laid facing the qiblah. Then he (peace and blessings be upon him) said nine takbirs over him. Then he gathered the other martyrs with him; whenever a martyr was brought, he was placed beside Hamzah (may Allah be pleased with him), and he (peace and blessings be upon him) would offer the funeral prayer over him and over the other martyrs, until he (peace and blessings be upon him) had offered the funeral prayer over him and the other martyrs seventy-two times. Then he (peace and blessings be upon him) stood over his Companions until they were buried. When the Qur'an was revealed, the Messenger of Allah (peace and blessings be upon him) forgave, overlooked, and abandoned the intention of mutilation.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11005