A gay couple is learning the hard way just how complicated United States immigration law can be, especially when it comes to same-sex couples and surrogacy.

Andrew and Elad Dvash-Banks moved to Canada in 2011 in order to get married and begin their lives together, as the United States had yet to legalize marriage equality. They had twins with the help of assisted reproductive technology (ART), using an anonymous egg donor and gestational surrogate, and both of their sperm.

Canada recognized both men as legal parents to the children, naming them both on each child’s birth certificate.

Andrew has dual U.S. and Canadian citizenship, and Elad is an Israeli citizen, and the couple eventually decided to return to the United States, thus kicking off all the trouble, Above The Law reports.

The U.S. Immigration Code ties the right to citizenship to DNA, and only Andrew has citizenship rights he could pass on to his offspring.

The immigration official working with the couple told them they would have to submit to DNA testing to determine which, if any, of their children would be granted citizenship. Requiring DNA proof is up to the officer’s discretion.

DNA testing proved what they already knew, that only one of their sons was genetically related to Andrew, and the other one to Elad.

The twin not genetically related to Andrew is in the country currently on a visitor’s visa, and their path forward is less than ideal.

Andrew can either sponsor his son as his “step-son” for a green card, or attempt to adopt him, despite already being on his birth certificate as the boy’s father.