Ezra 9-10
When Ezra and his company arrive in Jerusalem, he is told that there were many in Israel who had taken wives from among the pagans in the land, and Ezra responds with mourning and prayers to God. They ultimately do a census of all in the land who had taken foreign wives, and it was decreed that they each put away such foreign wives, or they would be excommunicated from the congregation of Israel. It was a prohibition from God that the children of Israel never intermarry with the pagan gentiles in the land, as such marriages always resulted in adopting the idol worship that the women had practiced before marriage.