A gay Italian couple were given the gift of twin baby boys with the help of in vitro fertilization and a surrogate mother in California, but faced opposition as soon as they returned to their home country.

When they returned to Milan with the newborns, a clerk at the registry office refused to transcribe the babies’ birth certificates, preventing them from the boys as their legal children, the Washington Post reports.

Surrogacy is illegal in Italy, and issues with parents registering their children as their own when returning home after turning to a surrogate is not uncommon. What happened in court after the couple sued was, however.

Since both men used their own separate sperm to fertilize the eggs, a judge ruled that each of the men could register their biological son as their own. The babies could not be registered as children of the couple and are not to be recognized as brothers, however, despite having the same mother.

Not only is surrogacy illegal in Italy, but in vitro fertilization is also limited to heterosexual couples, who must use their own sperm and eggs.

While same-sex civil unions was made legal last year in the country, same-sex marriage and adoption are still banned, meaning the men cannot even adopt their non-biological sons.

Famiglie Arcobaleno, a nongovernmental organization advocating the rights of same-sex parents and their children, helped the couple with their court case and declared the ruling a “positive step.”

“It’s the first time that an Italian court has established that a child’s best interest comes before [the legality of] how he or she was born,” said the group’s president, Marilena Grassadonia.

“The children’s interest was to have a parent. Also, until now the babies were only U.S. citizens, but finally their fathers can pass their Italian citizenship to them.”