Deuteronomy 20:16-20 - Laws Concerning War With Canaanite Nations

16 Do not spare anyone's life in the cities of these nations Jehovah your God is giving you as your property. 17 You must capture the Hittites, Amorites, Canaanites, Perizzites, Hivites, and Jebusites for Jehovah and completely destroy them. Jehovah your God commands you. 18 Otherwise, they will teach you to do all the disgusting things they do for their gods. You will sin against Jehovah your God.

19 This is what you must do whenever you blockade a city for a long time in order to capture it in war. Do not harm any of its fruit trees with an ax. You may eat the fruit. Never cut those trees down, because the trees of the field are not people you have come to blockade. 20 You may destroy trees that you know are not fruit trees. You may cut them down and use them in your blockade until you capture the city.