مَاكَانَ لِنَبِيٍّ اَنْ يَّكُوْنَ لَهٗٓ اَسْرٰى حَتّٰى يُثْخِنَ فِى الْاَرْضِۗ تُرِيْدُوْنَ عَرَضَ الدُّنْيَاۖ وَاللّٰهُ يُرِيْدُ الْاٰخِرَةَۗ وَاللّٰهُ عَزِيْزٌحَكِيْمٌ ( الأنفال: ٦٧ )
Maa kaana li Nabiyyin ai yakoona lahooo asraa hatta yuskhina fil ard; tureedoona aradad dunyaa wallaahu yureedul Aakhirah; wallaahu 'Azeezun Hakeem (al-ʾAnfāl 8:67)
Sahih International:
It is not for a prophet to have captives [of war] until he inflicts a massacre [upon Allah's enemies] in the land. You [i.e., some Muslims] desire the commodities of this world, but Allah desires [for you] the Hereafter. And Allah is Exalted in Might and Wise. (Al-Anfal [8] : 67)
1 Mufti Taqi Usmani
It is not befitting a prophet that he has captives with him unless he has subdued the enemy by shedding blood in the land. You intend to have the stuff of this world, while Allah intends the Hereafter (for you). And Allah is All-Mighty, All-Wise.