Surah Al-Anfal, ayah 67

8:67

مَا كَانَ لِنَبِيٍّ أَن يَكُونَ لَهُۥٓ أَسۡرَىٰ حَتَّىٰ يُثۡخِنَ فِي ٱلۡأَرۡضِۚ تُرِيدُونَ عَرَضَ ٱلدُّنۡيَا وَٱللَّهُ يُرِيدُ ٱلۡأٓخِرَةَۗ وَٱللَّهُ عَزِيزٌ حَكِيمٞ ٦٧

Mā kāna linabiyyin an yakūna lahū asrā hattā yuthkhina fil-ardi turīdūna 'aradad-dunyā wallāhu yurīdul-ākhirata wallāhu 'azīzun hakīm

It is not for a prophet to have captives [of war] until he inflicts a massacre [upon Allāh's enemies] in the land. You [i.e., some Muslims] desire the commodities of this world,457 but Allāh desires [for you] the Hereafter. And Allāh is Exalted in Might and Wise.

Footnotes

457 i.e., material benefit, such as the ransom paid for prisoners.