Deuteronomy 23:3-5

MSTC(i) 3 The Ammonites and the Moabites shall not come into the congregation of the LORD; no, not in the tenth generation, no they shall never come in to the congregation of the LORD, 4 because they met you not with bread and water in the way when ye came out of Egypt, and because they hired against thee Balaam the son of Beor, the interpreter of Mesopotamia, to curse thee. 5 Nevertheless, the LORD thy God would not hearken unto Balaam, but turned the curse to a blessing unto thee, because the LORD thy God loved thee.