Deuteronomy 31:20-31:30
When I bring them into the land flowing with milk and honey that I promised on oath to their fathers, and they eat their fill and grow fat and turn to other gods and serve them, spurning Me and breaking My covenant, and the many evils and troubles befall them--then this poem shall confront them as a witness, since it will never be lost from the mouth of their offspring. For I know what plans they are devising even now, before I bring them into the land that I promised on oath.
That day, Moses wrote down this poem and taught it to the Israelites. And He charged Joshua son of Nun: "Be strong and resolute: for you shall bring the Israelites into the land that I promised them on oath, and I will be with you."
When Moses had put down in writing the words of this Teaching to the very end, Moses charged the Levites who carried the Ark of the Covenant of the Lord, saying: Take this book of Teaching and place it beside the Ark of the Covenant of the Lord your God, and let it remain there as a witness against you. Well I know how defiant and stiffnecked you are: even now, while I am still alive in your midst, you have been defiant toward the Lord; how much more, then, when I am dead! Gather to me all the elders of your tribes and your officials, that I may speak all these words to them and that I may call heaven and earth to witness against them. For I know that, when I am dead, you will act wickedly and turn away from the path that I enjoined upon you, and that in time to come misfortune will befall you for having done evil in the sight of the Lord and vexed Him by your deeds.
Then Moses recited the words of this poem to the very end, in the hearing of the whole congregation of Israel.