Deut 23:3-5

3No Ammonite or Moabite shall be admitted to the assembly of the Lord. Even to the tenth generation, none of their descendants shall be admitted to the assembly of the Lord,4because they did not meet you with food and water on your journey out of Egypt, and because they hired against you Balaam son of Beor, from Pethor of Mesopotamia, to curse you.5(Yet the Lord your God refused to heed Balaam; the Lord your God turned the curse into a blessing for you, because the Lord your God loved you.)