Deuteronomy 23:4-5

Webster(i) 4 Because they met you not with bread and with water in the way, when ye came forth from 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 to Balaam: but the LORD thy God turned the curse into a blessing to thee, because the LORD thy God loved thee.