Deuteronomy 21:22-23

BSB(i) 22 If a man has committed a sin worthy of death, and he is executed, and you hang his body on a tree, 23 you must not leave the body on the tree overnight, but you must be sure to bury him that day, because anyone who is hung on a tree is under God’s curse. You must not defile the land that the LORD your God is giving you as an inheritance.