Leviticus 26:40-41

26:40 However, when they confess their iniquity and their ancestors’ iniquity which they committed by trespassing against me, by which they also walked in hostility against me 26:41 (and I myself will walk in hostility against them and bring them into the land of their enemies), and then their uncircumcised hearts become humbled and they make up for their iniquity,

Leviticus 26:44

26:44 In spite of this, however, when they are in the land of their enemies I will not reject them and abhor them to make a complete end of them, to break my covenant with them, for I am the Lord their God.