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

16 But from the cities of these peoples that Yahweh your God [is] giving to you as an inheritance, you shall not let anything live that breathes. 17 Rather, you shall utterly destroy them, the Hittites and the Amorites, the Canaanites and the Perizzites, the Hivites, and the Jebusites, [just] as Yahweh your God has commanded you, 18 so that they may not teach you to do like all their detestable things that they do for their gods and [thereby] you sin against Yahweh your God.

19 "If you besiege a town [for] many days to make war against it [in order to] seize it, you shall not destroy its trees by wielding an ax against them, for you may eat from them, and [so] you must not cut them down. Are the trees of the field humans that they should come in siege {against you}? 20 Only the trees that you know {are not fruit trees} you may destroy and you may cut down, and you may build siege works against that city that is making war with you {until it falls}."