The Messenger of Allah ﷺ consulted the people regarding the captives on the day of Badr and said, "Allah has placed them in your power."Umar bin Khattab stood up and said, "Messenger of Allah, strike off their necks."The Prophet ﷺ turned away from him.Then the Messenger of Allah ﷺ returned to the matter and said, "People, Allah has placed them in your power, and they were only your brothers yesterday."Umar stood up and said, "Messenger of Allah, strike off their necks."The Prophet ﷺ turned away from him.Then the Prophet ﷺ returned to the matter and said the same to the people. Abu Bakr stood up and said, "Messenger of Allah, perhaps you might pardon them and accept ransom from them."The grief that had been on the face of the Messenger of Allah ﷺ departed. He pardoned them and accepted ransom from them, and Allah
revealed, "Had it not been for a decree from Allah that preceded, you would have been afflicted by a great punishment for what you took" [Anfal 8:68], to the end of the verse.
حدثنا علي بن عاصم عن حميد عن أنس وذكر رجلا
استشار رسول الله ﷺ الناس في الأسارى يوم بدر فقال إن الله عز وجل قد أمكنكم منهم قال فقام عمر بن الخطاب فقال يا رسول الله اضرب أعناقهم قال فأعرض عنه النبي ﷺ قال ثم عاد رسول الله ﷺ فقال يا أيها الناس إن الله قد أمكنكم منهم وإنما هم إخوانكم بالأمس قال فقام عمر فقال يا رسول الله اضرب أعناقهم فأعرض عنه النبي ﷺ قال ثم عاد النبي ﷺ فقال للناس مثل ذلك فقام أبو بكر فقال يا رسول الله إن ترى أن تعفو عنهم وتقبل منهم الفداء قال فذهب عن وجه رسول الله ﷺ ما كان فيه من الغم قال فعفا عنهم وقبل منهم الفداء قال وأنزل الله عز وجل {لولا كتاب من الله سبق لمسكم فيما أخذتم} إلى آخر الآية
Its isnad is hasan, though the scholars of hadith criticized Ali bin Asim within this isnad. The story of the captives is found in Muslim 3/1383, no. 1763, in the chapter on jihad, on the aid of angels. It is likewise found in Tirmidhi 5/271, no. 3084, in the tafsir of Surah Anfal, where he graded it hasan, though he indicated its discontinuity, and then graded it hasan again in 3/213, no. 1714. It is also in Ibn Abu Shayba 12/417, no. 15098, in the chapter on jihad, on ransom, and likewise in 14/370, no. 18537, in the chapter on military campaigns, on the Battle of Badr. Hakim also graded it sahih in 2/21, and Dhahabi agreed with him.