In a first-of-its-kind ruling, a federal judge has ruled that the second of two twin boys born to a same-sex couple has the same rights and protections as a US citizen as his brother currently enjoys.

The two boys, Aiden and Ethan Dvash-Banks, were conceived using assisted reproductive technology (ART), with an anonymous egg donor and gestational surrogate in 2016 in Ontario, Canada.

Each boy was conceived using sperm from one of the two fathers: Aiden was conceived via Andrew Dvash-Banks’ sperm, while Ethan’s biological father is Elad.

Both men are recognized as legal parents to the boys and named on each child’s birth certificate.

Elad is an Israeli while Andrew has both American and Canadian citizenship. The couple met in Israel but moved to Canada in 2010 because the U.S. did not support marriage equality at the time. The pair were married in Canada in August of 2017.

Things became tricky for the family when they attempted to move to the United States. While applying for U.S. passports, the couple argued that both sons should be allowed because Andrew is an American citizen.

Related: Immigration officials asked these gay asylum seekers shocking questions & then rejected them

Andrew is also legally recognized as a father for both of the children, regardless of which of the men provided the sperm.

The State Department disagreed, telling the couple that they would need to have a DNA test for each boy, showing who was the biological father in order to prove citizenship. Once that was complete, the consulate only provided citizenship for Aiden.

The State Department told Andrew that he could either sponsor Ethan as his “step-son” in order to get his son a green card or attempt to adopt him. The latter would be complicated given that Andrew is already listed on the birth certificate as the boy’s father.

The couple sued for recognition of their marital status, arguing that they were being discriminated against by not approving citizen for both of their sons.

U.S. District Judge John F. Walter agreed with the family, saying that the State Department wrongfully denied citizenship to Ethan Dvash-Banks.

“The Court concludes that, under controlling Ninth Circuit authority, Section 301 does not require a person born during their parents’ marriage to demonstrate a biological relationship with both of their married parents,” said Judge Walter.

“Other than the gender of E.J.’s parents, the factual circumstances in Scales and Solis-Espinoza are indistinguishable from the facts in this case,” added Walter, referring to two previous cases.

“Both Scales and Solis-Espinoza make clear that the word ‘parents’ as used in Section 301(g) is not limited to biological parents and that the presumption of legitimacy that applies when a child is born to married parents – as codified in the [Immigration and Nationality Act] – cannot be rebutted by evidence that the child does not have a biological tie to a U.S. citizen parent.”

The couple was overjoyed at the decision.

“We are extremely pleased with the outcome,” said Elad in a video message from the couple, posted to Immigration Equality’s YouTube channel. “Justice has won, and we are extremely happy, and hope that Ethan will do great things, and hopefully, maybe, become a U.S. president one day.”

“I am so happy that my son Ethan is being recognized and treated under the law the same as his twin brother Aiden,” added Andrew.