Deuteronomy 20:10 - 20:18
10 “If you come near a city to fight against it, you shall call for terms of peace. 11 Now it will be that if it agrees to make peace with you and opens to you, then all the people who are found in it shall become your forced labor and shall serve you. 12 However, if it does not make peace with you, but makes war against you, then you shall besiege it. 13 And Yahweh your God shall give it into your hand, and you shall strike all the males in it with the edge of the sword. 14 Only the women and the little ones and the animals and all that is in the city, all its spoil, you shall plunder for yourself; and you shall consume the spoil of your enemies which Yahweh your God has given you. 15 Thus you shall do to all the cities that are very far from you, which are not of the cities of these nations nearby. 16 Only in the cities of these peoples that Yahweh your God is giving you as an inheritance, you shall not leave alive anything that breathes. 17 But you shall devote them to destruction, the Hittite and the Amorite, the Canaanite and the Perizzite, the Hivite and the Jebusite, as Yahweh your God has commanded you, 18 so that they may not teach you to do according to all their abominations which they have done for their gods, so that you would sin against Yahweh your God.