Deuteronomy 21:21-23 Amplified Bible (AMP)

21. Then all the men of his city shall stone him to death; so you shall cleanse out the evil from your midst, and all Israel shall hear and [reverently] fear.

22. And if a man has committed a sin worthy of death and he is put to death and [afterward] you hang him on a tree, [Josh. 10:26, 27.]

23. His body shall not remain all night upon the tree, but you shall surely bury him on the same day, for a hanged man is accursed by God. Thus you shall not defile your land which the Lord your God gives you for an inheritance. [Gal. 3:13.]

Deuteronomy 21