Deuteronomy 23:5

King James Version Bible (KJV)
Nevertheless the Lord thy God would not hearken unto Balaam; but the Lord thy God turned the curse into a blessing unto thee, because the Lord thy God loved thee.

Read Deuteronomy 23:5 in other translations