In Deut 7:1-6, God commands the Jews to not marry foreign women. In Ezra 9-10, Ezra learns that the people have done this anyway and some even had children, and Ezra commands the people to divorce those foreign wives.