Deuteronomy 20:13-14
20:13 The Lord your God will deliver it over to you and you must kill every single male by the sword.
20:14 However, the women, little children, cattle, and anything else in the city – all its plunder – you may take for yourselves as spoil. You may take from your enemies the plunder that the Lord your God has given you.