Deuteronomy 20:10-16 New Revised Standard Version (NRSV)
10 When you draw near to a town to fight against it, offer it terms of peace. 11 If it accepts your terms of peace and surrenders to you, then all the people in it shall serve you at forced labor. 12 If it does not submit to you peacefully, but makes war against you, then you shall besiege it; 13 and when the Lord your God gives it into your hand, you shall put all its males to the sword. 14 You may, however, take as your booty the women, the children, livestock, and everything else in the town, all its spoil. You may enjoy the spoil of your enemies, which the Lord your God has given you. 15 Thus you shall treat all the towns that are very far from you, which are not towns of the nations here. 16 But as for the towns of these peoples that the Lord your God is giving you as an inheritance, you must not let anything that breathes remain alive.