لَّوْلَا كِتَابٌ مِّنَ اللَّهِ سَبَقَ لَمَسَّكُمْ فِيمَا أَخَذْتُمْ عَذَابٌ عَظِيمٌ
Had it not been for a prior decree of Allah, surely there would have befallen you a great punishment for what you took.
Agha Ali Puya Commentary
Commentary on Quran 8:68
[Pooya/Ali Commentary 8:68] Any motive of worldly gains is condemned as worthy of a severe penalty. If taking of ransom had not already been legalised those who had taken the ransom would have been punished. This verse condemns the selfish desire for obtaining worldly gains. It does not give permission to kill the captives. Among those taken prisoners were the Holy Prophet's uncle Abbas and Ali's brother Aqil, who afterwards became Muslims.