A person who is genetically a male but to all outward appearances is female, or genetically female and appears to be male, may be suffering from the very rare condition of pseudohermaphrodism.
With a pseudohermaphrodite person who is a genetic male, the testes do not descend into the scrotum but remain in the abdomen and secrete only oestrogen and minimal or no testosterone resulting in the formation of breasts and female characteristics, although no or only a vestigial vagina is present. In the genetic females, the ovaries are damaged or develop a tumour and produce excessive testosterone. They appear muscular, develop facial hair and their clitoris enlarges to look like a small penis, but no scrotum develops.
The most common form of pseudohermaphrodism is androgen insensitivity syndrome (AIS). Appropriate surgical sexual reassignment is usually performed when the condition is detected, usually in the teenage years.