Bangkok’s Juvenile and Family Court ruled that Carmen’s legal guardian is the girl’s American, biological father, Gordon Lake, his lawyer, Rachapol Sirikulchit, said.
Lake and his partner, Spaniard, Manuel Santos, both 41, have been stuck in Thailand since launching their legal battle, after Carmen was born in January, 2015.
Santos emerged from the court smiling and with tears in his eyes.
He told reporters: “We won. We are really happy... This nightmare is going to end soon. After 15 months, Carmen will fly to Spain,” where the couple lives.
The case was complicated by the fact that Thai law does not recognise same-sex marriages and also by a new law that bans commercial surrogacy, which took effect after Carmen’s birth.
When Carmen was born, Thai surrogate, Patidta Kusolsang, handed over the baby to the couple, who left the hospital with the infant.
However, the mother then changed her mind and refused to sign the documents to allow Carmen to get a passport, so they could leave Thailand.
Mr Lake, who is from New Jersey, is Carmen’s biological father, while the egg came from an anonymous donor.
The couple were told the surrogate mother had thought they were an “ordinary family and that she worried for Carmen’s upbringing”.