If you hear it said about one of the towns the Lord your God is giving you to live in that troublemakers have arisen among you and have led the people of their town astray, […] then you must inquire, probe and investigate it thoroughly. And if it is true and it has been proved that this detestable thing has been done among you, you must certainly put to the sword all who live in that town. You must destroy it completely, both its people and its livestock. You are to gather all the plunder of the town into the middle of the public square and completely burn the town and all its plunder as a whole burnt offering to the Lord your God. That town is to remain a ruin forever, never to be rebuilt, and none of the condemned things are to be found in your hands. Then the Lord will turn from his fierce anger, will show you mercy, and will have compassion on you. He will increase your numbers, as he promised on oath to your ancestors — because you obey the Lord your God by keeping all his commands that I am giving you today and doing what is right in his eyes.
Source: Deuteronomy 13:12-18