Deut 20:16-18

16But as for the towns of these peoples that the Lord your God is giving you as an inheritance, you must not let anything that breathes remain alive.17You shall annihilate them—the Hittites and the Amorites, the Canaanites and the Perizzites, the Hivites and the Jebusites—just as the Lord your God has commanded,18so that they may not teach you to do all the abhorrent things that they do for their gods, and you thus sin against the Lord your God.