Deuteronomy 20:10-18 New American Bible (Revised Edition) (NABRE)
Cities of the Enemy. 10 When you draw near a city to attack it, offer it terms of peace. 11 If it agrees to your terms of peace and lets you in, all the people to be found in it shall serve you in forced labor. 12 But if it refuses to make peace with you and instead joins battle with you, lay siege to it, 13 and when the Lord, your God, delivers it into your power, put every male in it to the sword; 14 but the women and children and livestock and anything else in the city—all its spoil—you may take as plunder for yourselves, and you may enjoy this spoil of your enemies, which the Lord, your God, has given you.
15 [a]That is how you shall deal with any city at a considerable distance from you, which does not belong to these nations here. 16 But in the cities of these peoples that the Lord, your God, is giving you as a heritage, you shall not leave a single soul alive. 17 You must put them all under the ban—the Hittites, Amorites, Canaanites, Perizzites, Hivites, and Jebusites—just as the Lord, your God, has commanded you, 18 so that they do not teach you to do all the abominations that they do for their gods, and you thus sin against the Lord, your God.