Deuteronomy 17:2–7

When there shall be found among you within any of thy gates, which the Lord thy God shall give thee, man or woman that do evil in the sight of the Lord thy God, and transgress his covenant, 3So as to go and serve strange gods, and adore them, the sun and the moon, and all the host of heaven, which I have not commanded: 4And this is told thee, and hearing it thou hast inquired diligently, and found it to be true, and that the abomination is committed in Israel: 5Thou shalt bring forth the man or the woman, who have committed that most wicked thing, to the gates of thy city, and they shall be stoned. 6By the mouth of two or three witnesses shall he die that is to be slain. Let no man be put to death, when only one beareth witness against him. 7The hands of the witnesses shall be first upon him to kill him, and afterwards the hands of the rest of the people: that thou mayst take away the evil out of the midst of thee.