Deuteronomy 20:16-20 - Laws Concerning War With Canaanite Nations
16 "You are not to leave even one person alive in the cities of these nations that the LORD your God is about to give you as an inheritance. 17 You must completely destroy the Hittites, the Amorites, the Canaanites, the Perizzites, the Hivites, and the Jebusites, just as the LORD your God commanded you, 18 so they won't teach you to do all the detestable things that they do for their gods. If you do what they teach you, you will sin against the LORD your God."
19 "When you attack a city and have to fight against it for many days, don't destroy its trees by cutting them down with an ax. You may eat from them, but you must not cut them down. Are the trees of the field human beings, that you would come and attack them? 20 However, you may cut down the trees whose fruit you know isn't edible, in order to build siege works against the city that waged war with you, until it falls."