Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ahmad:13555ʿAlī b. ʿĀṣim > Ḥumayd > Anas And Dhakar a man > al-Ḥasan

[Machine] The Messenger of Allah ﷺ consulted the people regarding the captives on the Day of Badr. He said, "Indeed, Allah has made you victorious over them." Umar ibn al-Khattab stood up and said, "O Messenger of Allah, strike their necks." The Prophet ﷺ turned away from him. Then the Messenger of Allah ﷺ returned and said, "O people, indeed, Allah has made you victorious over them, and they are only your brothers from yesterday." Umar stood up and said, "O Messenger of Allah, strike their necks." The Prophet ﷺ turned away from him. Then the Prophet ﷺ returned and said the same thing to the people. Abu Bakr stood up and said, "O Messenger of Allah, we think you should forgive them and accept their ransom." The grief disappeared from the face of the Messenger of Allah ﷺ . He forgave them and accepted their ransom. And Allah revealed, "If not for a decree from Allah that preceded, you would have been touched for what you took by a great punishment" (Quran 8:68).  

أحمد:١٣٥٥٥حَدَّثَنَا عَلِيُّ بْنُ عَاصِمٍ عَنْ حُمَيْدٍ عَنْ أَنَسٍ وَذَكَرَ رَجُلًا عَنِ الْحَسَنِ قَالَ

اسْتَشَارَ رَسُولُ اللهِ ﷺ النَّاسَ فِي الْأُسَارَى يَوْمَ بَدْرٍ فَقَالَ إِنَّ اللهَ قَدْ أَمْكَنَكُمْ مِنْهُمْ قَالَ فَقَامَ عُمَرُ بْنُ الْخَطَّابِ فَقَالَ يَا رَسُولَ اللهِ اضْرِبْ أَعْنَاقَهُمْ قَالَ فَأَعْرَضَ عَنْهُ النَّبِيُّ ﷺ قَالَ ثُمَّ عَادَ رَسُولُ اللهِ ﷺ فَقَالَ يَا أَيُّهَا النَّاسُ إِنَّ اللهَ قَدْ أَمْكَنَكُمْ مِنْهُمْ وَإِنَّمَا هُمْ إِخْوَانُكُمْ بِالْأَمْسِ قَالَ فَقَامَ عُمَرُ فَقَالَ يَا رَسُولَاللهِ اضْرِبْ أَعْنَاقَهُمْ قَالَ فَأَعْرَضَ عَنْهُ النَّبِيُّ ﷺ قَالَ ثُمَّ عَادَ النَّبِيُّ ﷺ فَقَالَ لِلنَّاسِ مِثْلَ ذَلِكَ فَقَامَ أَبُو بَكْرٍ فَقَالَ يَا رَسُولَ اللهِ نَرَى أَنْ تَعْفُوَ عَنْهُمْ وَتَقْبَلَ مِنْهُمُ الْفِدَاءَ قَالَ فَذَهَبَ عَنْ وَجْهِ رَسُولِ اللهِ ﷺ مَا كَانَ فِيهِ مِنَ الْغَمِّ قَالَ فَعَفَا عَنْهُمْ وَقَبِلَ مِنْهُمُ الْفِدَاءَ قَالَ وَأَنْزَلَ اللهُ {لَوْلَا كِتَابٌ مِنَ اللهِ سَبَقَ لَمَسَّكُمْ فِيمَا أَخَذْتُمْ عَذَابٌ عَظِيمٌ} [الأنفال 68]