Deuteronomy 9:4-5

ASV(i) 4 Speak not thou in thy heart, after that Jehovah thy God hath thrust them out from before thee, saying, For my righteousness Jehovah hath brought me in to possess this land; whereas for the wickedness of these nations Jehovah doth drive them out from before thee. 5 Not for thy righteousness, or for the uprightness of thy heart, dost thou go in to possess their land; but for the wickedness of these nations Jehovah thy God doth drive them out from before thee, and that he may establish the word which Jehovah sware unto thy fathers, to Abraham, to Isaac, and to Jacob.