Deuteronomy 23:5 in the World English Bible
Nevertheless the LORD your God wouldn’t listen to Balaam, but the LORD your God turned the curse into a blessing to you, because the LORD your God loved you.
Context
4 Because they met you not with bread and with water in the way, when ye came forth out of Egypt; and because they hired against thee Balaam the son of Beor of Pethor of Mesopotamia, to curse thee.
5 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.
6 Thou shalt not seek their peace nor their prosperity all thy days for ever.