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

16 Only in the cities of these peoples that the Lord your God is giving you as an inheritance, you shall not leave alive anything that breathes. 17 But you shall utterly destroy them, the Hittite, the Amorite, the Canaanite, the Perizzite, the Hivite and the Jebusite, just as the Lord your God has commanded you, 18 so that they will not teach you to act in accordance with all the detestable practices which they have done [in worship and service] for their gods, and in this way cause you to sin against the Lord your God.

19 “When you besiege a city for a long time, making war against it in order to capture it, you shall not destroy its [fruit-bearing] trees by swinging an axe against them; for you may eat from them, and you shall not cut them down. For is the tree of the field a man, that it should be besieged (destroyed) by you? 20 Only the trees which you know are not fruit trees shall you destroy and cut down, so that you may build siegeworks against the city that is making war with you until it falls.