Deuteronomy 3:20

3:20 You must fight until the Lord gives your countrymen victory as he did you and they take possession of the land that the Lord your God is giving them on the other side of the Jordan River. Then each of you may return to his own territory that I have given you.”

Deuteronomy 9:5

9:5 It is not because of your righteousness, or even your inner uprightness, that you have come here to possess their land. Instead, because of the wickedness of these nations the Lord your God is driving them out ahead of you in order to confirm the promise he made on oath to your ancestors, to Abraham, Isaac, and Jacob.