Deuteronomy Chapter 20v10-20
10 “When you draw near to a city to fight against it, offer terms of peace to it. 11 And if it responds to you peaceably and it opens to you, then all the people who are found in it shall do forced labor for you and shall serve you. 12 But if it makes no peace with you, but makes war against you, then you shall besiege it. 13 And when the Lord your God gives it into your hand, you shall put all its males to the sword, 14 but the women and the little ones, the livestock, and everything else in the city, all its spoil, you shall take as plunder for yourselves. And you shall enjoy the spoil of your enemies, which the Lord your God has given you. 15 Thus you shall do to all the cities that are very far from you, which are not cities of the nations here. 16 But in the cities of these peoples that the Lord your God is giving you for an inheritance, you shall save alive nothing that breathes, 17 but you shall devote them to complete destruction,[a] the Hittites and the Amorites, the Canaanites and the Perizzites, the Hivites and the Jebusites, as the Lord your God has commanded, 18 that they may not teach you to do according to all their abominable practices that they have done for their gods, and so you sin against the Lord your God.
19 “When you besiege a city for a long time, making war against it in order to take it, you shall not destroy its trees by wielding an axe against them. You may eat from them, but you shall not cut them down. Are the trees in the field human, that they should be besieged by you? 20 Only the trees that you know are not trees for food you may destroy and cut down, that you may build siegeworks against the city that makes war with you, until it falls.