Urwah bin al-Zubayr (may Allah have mercy on him) said that Marwan bin al-Hakam and Miswar bin Makhramah (may Allah be pleased with them both) related that the delegation of Hawazin asked the Messenger of Allah (peace and blessings be upon him) to return their wealth and captives. the Messenger of Allah (peace and blessings be upon him) said: "With me are those whom you see, and the speech most beloved to me is the most truthful. You may choose one of the two (the wealth or the captives), and I have been giving you time." the Messenger of Allah (peace and blessings be upon him) had given them a respite of ten-odd nights on his return from Ta'if. When they became certain that he (peace and blessings be upon him) would return only one of the two, they asked for the return of the captives. So the Messenger of Allah (peace and blessings be upon him) praised Allah as He deserves, then said: "Amma ba'd (To proceed): Your brothers have come in repentance, and I wish to return their captives to them. Whoever among you wishes to do this willingly, let him do so, and whoever wishes to receive compensation for them, we will give him its replacement from the first fay' (that Allah grants us)." The people said: "We return them willingly, O Messenger of Allah (peace and blessings be upon him)." the Messenger of Allah (peace and blessings be upon him) said: "We cannot know who gives permission and who does not. Go back and tell your leaders, and let them inform us." So the people spoke to their chiefs, and they informed the Messenger of Allah (peace and blessings be upon him) that the people had given permission willingly. This is the report that reached me concerning the captives of Hawazin.
(b) Imam al-Shafi'i (may Allah have mercy on him) said: the Messenger of Allah (peace and blessings be upon him) released some of the captives of Badr after taking ransom, from some he took nothing at all, and some he had executed. the Messenger of Allah (peace and blessings be upon him) had two of the captives of Badr executed: Uqbah bin Abi Mu'ayt and al-Nadr bin al-Harith.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 18024