A surrogate mother with learning difficulties has won a legal fight to keep a baby she carried for a same sex couple.
The woman, who is in her early 20s, is better placed than the two men to meet the little boy's emotional needs, a UK High Court judge has concluded.
Ms Justice Russell said the boy had an "undiagnosed illness affecting his brain".
She said it was in his best interests to remain living with the woman.
The judge had analysed a dispute over the boy's future between the woman and the two men at a private hearing in the Family Division of the High Court in London.
She said, in a written ruling, that no-one involved could be identified. Ms Justice Russell said the two men had been introduced to the woman through a Facebook surrogacy site.
The woman had signed an agreement in a fast-food outlet.
She had decided that she did not want to hand the baby to the men some months before he was born. Ms Justice Russell said the case was "yet another example" of the difficulties created by unregulated surrogacy arrangements.
She said the woman was of "limited income" and lived with a man who did manual work.
The two men were "professionals" and in a "much more secure" social and economic position. Ms Justice Russell said the boy would be able to stay in contact with the men, one of whom was his biological father.
The judge did not give the baby's age - but said he had been born in the summer of 2015. She said the case had been "distressing" for all involved.
"It is yet another example of the difficulties that arise out of the unregulated market in surrogacy," she said.
"(The men) were introduced to (the surrogate mother) through a Facebook surrogacy site."
She said there had been no screening, and she added: "This unregulated form of surrogacy means that there are, on the one side, vulnerable surrogates, and on the other commissioning parents who are legally unprotected from unpredictable outcomes."
Ms Justice Russell said that after analysing evidence, she had decided that it was in the little boy's best interests to stay with the woman.
"She is better placed to meet his emotional needs," said the judge.
"She is, quite apparently, more emotionally available and has a greater instinctive understanding of his emotional needs."
Ms Justice Russell said the woman would be able to treat the men in a "open and generous way" and allow the little boy to develop a good relationship with them.
The judge had heard legal argument from barristers Deirdre Fottrell QC and Richard Jones - who represented the woman, and barrister Marisa Allman - who represented the men.
Barrister Seamus Kearney had represented the interests of the baby and had been instructed by the Children and Family Court Advisory and Support Service (Cafcass).