Deuteronomy 7:3
1 When the Lord your God brings you to the land that you are going to occupy and forces out many nations before you—Hittites, Girgashites, Amorites, Canaanites, Perizzites, Hivites, and Jebusites, seven nations more numerous and powerful than you— 2 and he delivers them over to you and you attack them, you must utterly annihilate them. Make no treaty with them and show them no mercy! 3 You must not intermarry with them. Do not give your daughters to their sons or take their daughters for your sons, 4 for they will turn your sons away from me to worship other gods. Then the anger of the Lord will erupt against you and he will quickly destroy you. 5 Instead, this is what you must do to them: You must tear down their altars, shatter their sacred pillars, cut down their sacred Asherah poles, and burn up their idols.
Ezra 9:2
1 Now when these things had been completed, the leaders approached me and said, “The people of Israel, the priests, and the Levites have not separated themselves from the local residents who practice detestable things similar to those of the Canaanites, the Hittites, the Perizzites, the Jebusites, the Ammonites, the Moabites, the Egyptians, and the Amorites. 2 Indeed, they have taken some of their daughters as wives for themselves and for their sons, so that the holy race has become intermingled with the local residents. Worse still, the leaders and the officials have been at the forefront of all this unfaithfulness!” 3 When I heard this report, I tore my tunic and my robe and ripped out some of the hair from my head and beard. Then I sat down, quite devastated. 4 Everyone who held the words of the God of Israel in awe gathered around me because of the unfaithful acts of the people of the exile. Devastated, I continued to sit there until the evening offering.
Notes and References
"... The relatively few returning exiles would have found the land occupied by many of the neighboring peoples. Their socioeconomic and political situation would be best described by the Deuteronomic curse: 'The alien in your midst shall rise above you higher and higher, while you sink lower and lower; he shall be your creditor, but you shall not be his; he shall be the head and you the tail' (Deuteronomy 28:43). Under these circumstances, intermarriage would also have been one directional-pointing the other way. The new ger - politically independent, socially secure, economically better off - would have become a desirable spouse. Israel, though in its own land, was now threatened with assimilation. Thus among Ezra's first tasks was to stem this assimilationist tide. Without the benefit of an explicit legal precedent, he had to create a halakhic midrash (Ezra 9:2, 12), combining D's declaration that the people Israel are holy (Deuteronomy 7, etc.) (i.e., a sanctum) and P's dictum that the desecration of a sanctum merits divine punishment, but in the case of inadvertence - Israel being innocent of Ezra's 'law' -the sin is expiable by the dissolution of the illicit marriages, followed by an 'asam offering (Leviticus 4:14-16; compare Jeremiah 2:3; Malachi 2:1 1) ..."
Milgrom, Jacob Leviticus 17-22: A New Translation with Introduction and Commentary (p. 1585) Doubleday, 2000