A nine-year-old girl conceived by donor insemination found herself at the centre of family court litigation after one of her two "mothers" set up home with a female-to-male transsexual.
The transsexual wanted a judge to rule that he could stay in touch with the girl following the acrimonious breakdown of his relationship with the girl's "non-biological mother".
But Judge Clifford Bellamy, who sits in Leicester, has blocked the bid - saying the girl might be damaged.
He suggested that the "exceptional circumstances" of the case showed that modern family life could be "complicated".
Detail has emerged in a written ruling by the judge.
He said no one involved could be identified.
The judge said the girl's biological mother was in a relationship with the non-biological mother when she was conceived with sperm from a donor.
He said the girl's biological father had been in a relationship with a man.
Judge Bellamy said the girl's two "mothers" separated when she was about three and she stayed with her non-biological mother after the split - not her biological mother.
The non-biological mother subsequently set up home with the transsexual, but that relationship ended more than two years ago and the transsexual had set up home with a man.
The transsexual has taken legal action to stay in the youngster's life but the judge refused his application for contact with the girl.
He said the girl already engaged with a "range of adults" and allowing the transsexual's application could have a "damaging effect" on her welfare.
"(The girl's) story is an example of the different ways in which modern family life is formed," said Judge Bellamy in his ruling. "Modern family life can be complicated."
Judge Bellamy said the girl's non-biological mother, biological mother and biological father were concerned about the transsexual having contact.
The judge said the girl continued to live with her non-biological mother, had regular contact with her biological mother - who had health problems - and spent time with her biological father.
He said she was aware of the litigation and the transsexual's application and had not expressed "any particular view". He said, if anything, she "appeared disinterested".
Judge Bellamy was given detail of the transsexual's relationship with the girl during the four years he lived with her non-biological mother.
The judge was told the girl knew who her biological father was.
But the judge heard that she called the transsexual "Dad" - and was told he had "played a part" in caring for her.
The transsexual said the girl had "only ever known him as a man" although she had been aware of his transition from female to male.
Judge Bellamy was told that the non-biological mother had been concerned about aspects of the girl's behaviour when she was living with the transsexual.
"Whilst (they) were cohabiting, (the girl) began to call herself (a boy's name) and stated that she was a boy," said the judge.
"Some days she would wear clothes usually chosen by boys.
"There were times when she avoided playing with gender-appropriate toys.
"(The non-biological mother) was very concerned about this.
"She felt that (the transsexual) was encouraging this behaviour. (He) denies that that was the case.
"(The non-biological mother) says that this behaviour has stopped since she and (the transsexual) separated."