By Caroline Ryan
BBC News Online health staff
When a baby is born, parents eagerly wait to hear if they have a boy or a girl.
Children with the condition will require many operations
But in very rare cases, doctors have to help parents decide what gender their child will be.
If they are affected by cloacal exstrophy, children's genitals - along with the rest of the pelvis including the bladder and the bowel - do not form normally.
It is an extremely serious condition and, in the past, babies affected by it died.
Developments in medical technology now mean they can be saved.
But when children who are genetically male are affected by the condition, doctors have to decide if they can live as a male, or if surgery is needed to give them female genitals.
Experts are divided over how this delicate decision should be approached.
US researchers claim many of those given a female gender at birth decide to live as males later in life.
The team, from Johns Hopkins University in Baltimore and the University of Oklahoma assessed 14 genetic males aged five to 16 years old, who had been assigned socially, legally and surgically as female.
Eight had declared themselves as male during the follow-up period, which lasted up to eight years.
Dr William Reiner, who led the study, said children had chosen the gender they felt most comfortable with.
"They said 'When mom and dad said I was a boy, it all made sense. Then I realised it was true. Then it just happened'.
"Children transition extraordinarily rapidly."
Dr Reiner said the decision to remove a child's testicles at birth and carry out surgery to give them female genitals was based on the belief that children are sexually and psychologically neutral at birth, what their genitals looked like and how they were brought up.
But he said: "Those are enormous assumptions", adding recent research suggested hormones released before birth had a major influence on a child's sexuality.
However, doctors at London's Great Ormond Street Hospital who treat children with the condition, says the US research focuses on children referred for treatment because they have had problems, rather than looking at a cross-section of children with cloacal exstrophy.
Dr Polly Carmichael, a psychologist who works with children affected by cloacal exstrophy, told BBC News Online the decision was based on many factors, including what the child's genitals look like.
She said: "The penis is often very small, and gender assignment has been based on the viability of that as a functioning organ."
But she said psychologists and endocrinologists, as well as the child's parents, would decide what was best for that child.
Dr Carmichael accepted it was a difficult decision to make for someone who was just a baby - but that failing to do so could lead to different problems for the child and their family.
"Some people have argued that you shouldn't assign a sex at birth, and you should just wait and see.
"But how would a child feel later on in terms of making its way in the world?"
Only around half of genetic males with the condition treated at Great Ormond Street are reared as girls.
In the past, virtually all would have been raised as females.
A spokesman for the hospital said: "We are in the last stages of a study looking at children treated for cloacal exstrophy here in the last 20 years.
"The evidence from our study is that the children generally are comfortable in their female identity."
He added: "These are complex issues, and it has to be said that any child born with the condition could suffer psychological difficulty regardless of whether they are gender reassigned or not."