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.
bayhaqi:12857Abū Zakariyyā b. Abū Isḥāq al-Muzakkī > Abū al-Ḥasan b. ʿUbdūs > ʿUthmān b. Saʿīd al-Dārimī > ʿAbdullāh b. Ṣāliḥ > Muʿāwiyah b. Ṣāliḥ > ʿAlī b. Abū Ṭalḥah

[Machine] In his statement, "It is not for a prophet to have captives until he has thoroughly subdued the land," (Surah Al-Anfal 67), this was on the day of Badr, and the Muslims were few in number. But when they increased in number and their power intensified, Allah revealed this verse regarding the captives, "So, either a favor afterward or a ransom until the war lays down its burdens" (Surah Muhammad 4). So Allah made the Prophet and the believers have the choice regarding the matter of the captives: whether to kill them, or to enslave them, or to set them free.  

البيهقي:١٢٨٥٧أَخْبَرَنَا أَبُو زَكَرِيَّا بْنُ أَبِي إِسْحَاقَ الْمُزَكِّي أنا أَبُو الْحَسَنِ بْنُ عُبْدُوسٍ ثنا عُثْمَانُ بْنُ سَعِيدٍ الدَّارِمِيُّ ثنا عَبْدُ اللهِ بْنُ صَالِحٍ ثنا مُعَاوِيَةُ بْنُ صَالِحٍ عَنْ عَلِيِّ بْنِ أَبِي طَلْحَةَ عَنِ ابْنِ عَبَّاسٍ

فِي قَوْلِهِ {مَا كَانَ لِنَبِيٍّ أَنْ يَكُونَ لَهُ أَسْرَى حَتَّى يُثْخِنَ فِي الْأَرْضِ} [الأنفال 67] وَذَلِكَ يَوْمَ بَدْرٍ وَالْمُسْلِمُونَ يَوْمَئِذٍ قَلِيلٌ فَلَمَّا كَثُرُوا وَاشْتَدَّ سُلْطَانُهُمْ أَنْزَلَ اللهُ تَعَالَى هَذَا فِي الْأُسَارَى {فَإِمَّا مَنًّا بَعْدُ وَإِمَّا فِدَاءً} [محمد 4] فَجَعَلَ اللهُ النَّبِيَّ وَالْمُؤْمِنِينَ بِالْخِيَارِ فِي أَمْرِ الْأُسَارَى إِنْ شَاءُوا قَتَلُوهُمْ وَإِنْ شَاءُوا اسْتَعْبَدُوهُمْ وَإِنْ شَاءُوا فَادَوْهُمْ