Deuteronomy 17:2-13

2 aIf there is found among you, within any of your towns that the Lord your God is giving you, a man or woman who does what is evil in the sight of the Lord your God, bin transgressing his covenant, 3and has gone and served other gods and worshiped them, or cthe sun or the moon or any of the host of heaven, dwhich I have forbidden, 4and it is told you and you hear of it, then you shall inquire ediligently, and if it is true and certain that such an abomination has been done in Israel, 5then you shall bring out to your gates that man or woman who has done this evil thing, and you fshall stone that man or woman to death with stones. 6 gOn the evidence of two witnesses or of three witnesses the one who is to die shall be put to death; a person shall not be put to death on the evidence of one witness. 7 hThe hand of the witnesses shall be first against him to put him to death, and afterward the hand of all the people. So iyou shall purge
Septuagint drive out; also verse 12
the evil
Or  evil person; also verse 12
from your midst.

Legal Decisions by Priests and Judges

8If any case arises requiring decision between one kind of homicide and another, one kind of legal right and another, or one kind of assault and another, any case within your towns that is too difficult for you, then you shall arise and go up to lthe place that the Lord your God will choose. 9 mAnd you shall come to the Levitical priests and to the judge who is in office in those days, and you shall consult them, and nthey shall declare to you the decision. 10Then you shall do according to what they declare to you from that place that the Lord will choose. And you shall be careful to do according to all that they direct you. 11According to the instructions that they give you, and according to the decision which they pronounce to you, you shall do. You shall not turn aside from the verdict that they declare to you, either to the right hand or to the left. 12The man who oacts presumptuously by not obeying the priest pwho stands to minister there before the Lord your God, or the judge, that man shall die. So qyou shall purge the evil from Israel. 13And all the people rshall hear and fear and not act presumptuously again.

Copyright information for ESV