The Department of State has ended appeals in two cases challenging the U.S. citizenship of children born abroad to married same-sex, U.S. citizen couples.

On Monday, the government withdrew its appeal in Kiviti v. Pompeo and decided not to appeal a ruling in Mize-Gregg v. Pompeo. The State Department argued that the children were “born out of wedlock” because they were not biologically related to both parents. However, the children of heterosexual U.S. citizens born abroad are automatically considered U.S. citizens.

The White House had defended the policy, saying that it “pertained to surrogacy” not the sexual orientation of the parents.

LGBT legal group Lambda Legal and Immigration Equality represented the families.

“Every court to have looked at this issue has concluded that the Department of State cannot refuse to recognize the U.S. citizenship of children born abroad to married same-sex couples,” Omar Gonzalez-Pagan, senior attorney at Lambda Legal, said in a statement. “We are gratified that the victories of the Kiviti and Mize-Gregg families are now final and we hope that the Trump Administration and the State Department will abide by these courts’ decisions when it encounters other families headed by same-sex couples. No family should have to go through what the Kiviti and Mize-Gregg families endured.”

“These two cases squarely rejected the State Department’s attempt to insert a harmful, baseless biology requirement into the citizenship protections children of married citizen parents receive. In so doing, these courts kept the promise of Obergefell that married same-sex couples are entitled to the full range of marital protections, and that includes the right to be recognized as their children’s parents regardless of who has a biological connection.” said Karen Loewy, senior counsel at Lambda Legal, referring to the 2015 Supreme Court case that struck down state laws and constitutional amendments that prohibited gay and lesbian couples from marrying.