A long time after that, when the LORD had given Israel rest from all their enemies on every side, and Joshua had grown old and advanced in years, that Joshua called all Israel, their elders and their heads and their judges and their officers, and said to them, “I am old and advanced in years. And you have seen all that the LORD your God has done to all these nations for your sake; for the LORD your God is He who has been fighting for you. [Ex 14:14] See, I have allotted to you these nations that remain as an inheritance for your tribes, with all the nations which I have cut off, from the Jordan [on the east] to the Great [Mediterranean] Sea toward the setting sun. The LORD your God will push them away from before you and drive them out of your sight and you will take possession of their land, just as the LORD your God promised you. Be steadfast and very determined to keep and to do everything that is written in the Book of the Law of Moses, so that you do not turn aside from it to the right or the left, so that you do not associate with these nations which remain among you, or mention the name of their gods, or make anyone swear [an oath by them], or serve them, or bow down to them. But you are to cling to the LORD your God, just as you have done to this day. For the LORD has driven out great and mighty nations from before you; and as for you, no man has been able to stand [in opposition] before you to this day. One of your men puts to flight a thousand, for the LORD your God is He who is fighting for you, just as He promised you. So be very careful and watchful of yourselves to love the LORD your God. For if you ever turn back and cling to the rest of these nations, these that are left among you, and intermarry with them, so that you associate with them and they with you, know and understand with certainty that the LORD your God will not continue to drive these nations out from before you; but they will be a snare and trap to you, and a whip on your sides and thorns in your eyes, until you perish from this good land which the LORD your God has given you.
“Now behold, today I am going the way of all the earth, and you know in all your hearts and in all your souls that not one word of all the good words which the LORD your God has promised concerning you has failed; all have been fulfilled for you, not one of them has failed. It shall come about that just as every good word which the LORD your God spoke and promised to you has been fulfilled for you, so the LORD will bring upon you every bad thing [about which He warned you], until He has destroyed and eliminated you from this good land which the LORD your God has given you. When you transgress (violate) the covenant of the LORD your God, which He commanded you [to follow], and you go and serve other gods and bow down to them, then the anger of the LORD will be kindled against you, and you shall perish quickly from the good land which He has given you.”