The Messiah dying on the cross is foreshadowed in Deuteronomy 21:23

Bible passage: Deuteronomy 21:23
Prophet: Moses
Written: As early as 1400 BC

In Deuteronomy, Moses is giving instructions for removing the bodies of people who havec been executed on the same day during which they were executed:

22 If someone guilty of a capital offense is put to death and their body is exposed on a pole, 23 you must not leave the body hanging on the pole overnight. Be sure to bury it that same day, because anyone who is hung on a pole is under God's curse. You must not desecrate the land the Lord your God is giving you as an inheritance. (Deuteronomy 21:22-23)

In the New Testament epistle, Galatians, the writer cites this requirement in reference to Jesus' crucifixion:

13 Christ redeemed us from the curse of the law by becoming a curse for us, for it is written: "Cursed is everyone who is hung on a pole." 14 He redeemed us in order that the blessing given to Abraham might come to the Gentiles through Christ Jesus, so that by faith we might receive the promise of the Spirit. (Galatians 3:13-14, NIV)

For this reason, some Bible scholars and Bible commentators will cite Deuteronomy 21:23 as a Messianic prophecy, not because it was necessarily predictive in a Messianic sense, but because the ultimate fulfillment is found in the execution of the Messiah, Jesus.