Hidden in Deuteronomy is yet another prophecy about the Messiah; it predicts the way in which the Savior would die and the length of time he would remain on the cross.
Deuteronomy 21:22–23 says that God cursed any man executed for breaking one of God’s commands. His body hanging on a pole was a public display of judgment. Jesus took on this curse for all of humanity when he died on the “cross” (1 Peter 2:24), fulfilling the prophecy in Deuteronomy 21:23. The apostle Paul reiterates this concept in Galatians 3:13.
Deuteronomy 21:23 also commanded that the offender’s body not be left on the pole overnight, and as we know from the Gospels, Jesus’ body was taken down and placed into the tomb before nightfall (see Matthew 27:57–60; Mark 15:42–46).
Taken from “How Is Jesus’ Death Foretold in Deuteronomy 21:23?” from the NIV Case for Christ Study Bible (used by permission).