Deuteronomy 23:3
1 A man with crushed or severed genitals may not enter the assembly of the Lord. 2 A person of illegitimate birth may not enter the assembly of the Lord; to the tenth generation no one related to him may do so. 3 No Ammonite or Moabite may enter the assembly of the Lord; to the tenth generation none of their descendants shall ever do so, 4 for they did not meet you with food and water on the way as you came from Egypt, and furthermore, they hired Balaam son of Beor of Pethor in Aram Naharaim to curse you. 5 But the Lord your God refused to listen to Balaam and changed the curse to a blessing, for the Lord your God loves you.
Nehemiah 13:1
1 On that day the book of Moses was read aloud in the hearing of the people. They found written in it that no Ammonite or Moabite may ever enter the assembly of God, 2 for they had not met the Israelites with food and water, but instead had hired Balaam to curse them. (Our God, however, turned the curse into blessing.) 3 When they heard the law, they removed from Israel all who were of mixed ancestry.
Notes and References
"... On some occasions, there can be no doubt that the text of Deuteronomy 5—26 is in view. Quoting Deuteronomy 24:16, the author of 2 Kings 14:6 (compare 2 Chron 25:4) states that Amaziah (c. 800-783 B.C.) “did not put to death the children of the murderers; according to what is written in the book of the law of Moses, where the LORD commanded, ‘The parents shall not be put to death for the children, or the children be put to death for the parents; but all shall be put to death for their own sins’” (NRSV). Although no quotation is provided, Nehemiah 13:1 unmistakably alludes to Deuteronomy 23:3, which states that Ammonites and Moabites should be excluded from the assembly of God ..."
Alexander, T. Desmond, and David W. Baker Dictionary of the Old Testament: Pentateuch (p. 68) InterVarsity Press, 2003