The father claimed the child's mother had agreed to be a surrogate before conception, which was done by artificial insemination at home, and that he and his partner would co-parent the child. The woman contended, however, that the girl's father would be in effect a sperm donor and that she would be the child's main carer.
Ruling in favour of the men, the High Court concluded that the woman had deceived them into believing they would be the main carers, and that it was in best interests of the girl - known only as M - to live with her father and his partner.
'[The child] was not conceived by two people in a sexual relationship,' Ms Justice Russell ruled. 'The pregnancy was contrived with the aim of a same-sex couple having a child to form a family assisted by a friend, this was ostensibly acquiesced to by all parties at the time the agreement was entered into and conception took place.'
Both men now have parental responsibility and the mother will only be allowed supervised access. Ms Justice Russell said this 'coincides with the reality of [the child's] conception and accords with [her] identity and place within her family.'
The judge also found that the woman had attempted to discredit the men in a 'homophobic and offensive manner' and had relied on 'stereotypical views on the nature of their relationship'. She also said that the woman's decision to breastfeed the child on demand and co-sleep with her had affected the amount of time the child could spend with her father.
Ms Justice Russell concluded that the woman was unable to put the child first and meet her emotional needs 'now and in the long term'.
Under current UK law, surrogates are the legal mother of any child they carry, even if they are not genetically related. It is only until six weeks after the birth that they can consent to a paternal order needed to transfer the rights onto the intended parents - something that didn't happen in this case.
A leading fertility lawyer has said that it is now high time that the law on surrogacy is changed. Natalie Gamble, of law firm Natalie Gamble Associates, said: 'The laws in place were written in the 1980s and the world has moved on. I don't think they were ever properly thought through.'
'The situation around UK-based surrogacy is driving thousands of parents overseas every year and creating new issues such as children born to UK parents being stuck abroad. What we urgently need is a proper structure,' she added.
Ms Justice Russell also commented on the current state of the law. 'The lack of a properly supported and regulated framework for arrangements of this kind has, inevitably, lead to an increase in these cases before the Family Court,' she said.