Deuteronomy 23:5

New American Standard Bible (NASB)
Nevertheless, the Lord your God was not willing to listen to Balaam, but the Lord your God turned the curse into a blessing for you because the Lord your God loves you.

Read Deuteronomy 23:5 in other translations