Deut. 9:4-6:
Hear, O Israel! You are about to cross the Jordan today, to go in and dispossess nations larger and mightier than you, great cities, fortified to the heavens, a strong and tall people, the offspring of the Anakim, whom you know. You have heard it said of them, "Who can stand up to the Anakim?" Know then today that the Lord your God is the one who crosses over before you as a devouring fire; he will defeat them and subdue them before you, so that you may dispossess and destroy them quickly, as the Lord has promised you. When the Lord your God thrusts them out before you, do not say to yourself, "It is because of my righteousness that the Lord has brought me in to occupy this land"; it is rather because of the wickedness of these nations that the Lord is dispossessing them before you. It is not because of your righteousness or the uprightness of your heart that you are going in to occupy their land; but because of the wickedness of these nations the Lord your God is dispossessing them before you, in order to fulfill the promise that the Lord made on oath to your ancestors, to Abraham, to Isaac, and to Jacob. Know, then, that the Lord your God is not giving you this good land to occupy because of your righteousness; for you are a stubborn people.Deut. 11:22-23:
If you will diligently observe this entire commandment that I am commanding you, loving the Lord your God, walking in all his ways, and holding fast to him, then the Lord will drive out all these nations before you, and you will dispossess nations larger and mightier than yourselves.Granted, these verses are talking about the initial conquest of the land. But the implication is that, if we are not entirely righteous, we will still the conquer the land but in a long, drawn-out process.