The Imam, with respect to captives, has it in his choice to slay them because the Prophet put captives to death and also because slaying them terminates wickedness; or, if he choose, he may make them slaves, because by enslaving them the wickedness of them is remedied, and at the same time the Muslims reap an advantage; or, if he please, he may release them so as to make them freemen and Zimmis, according to what is recorded of Omar. … but it is not lawful so to release the idolaters of Arabia, or apostates… If captives become Muslims, let not the Imam put them to death; … but yet he may lawfully make them slaves, after their conversion…
— BURHAN AL-DIN AL-MARGHINANI