Deuteronomy 23:5 NIV

5 However, the LORD your God would not listen to Balaam but turned the curse into a blessing for you, because the LORD your God loves you.

References for Deuteronomy 23:5