For one woman, the inability to keep any food down was caused by an incredibly rare condition called "Rapunzel syndrome," according to a new report of her case.

Named for the fairy tale princess with incredibly long hair, the extremely uncommon condition occurs when a person has a hairball in his or her stomach, and the hairball has a tail that extends into the intestines.

Rapunzel syndrome is caused by a psychiatric disorder in which people compulsively swallow their own hair, called trichophagia. Trichophagia is related to a slightly more common disorder in which people have an irresistible urge to pull out their hair, called trichotillomania. 

The 38-year-old woman went to the doctor after two days of nausea, vomiting and constipation, according to the report of her case, published Oct. 6 in the journal BMJ Case Reports.

She had been throwing up any food that she tried to eat, and her abdomen was protruding from her body, the doctors who treated her wrote in the report. In addition, the woman had lost about 15 lbs. (7 kilograms) over the previous eight months, and her appetite had significantly decreased over the previous year.

The doctors ran several tests, but none revealed the cause of her symptoms, according to the report. A blood test, however, did show that she had low levels of protein in her blood.

The doctors suspected that the woman's symptoms were likely being caused by something obstructing her digestive tract, and decided to operate.

They discovered a large hairball in her stomach measuring 6 x 4 inches (15 x 10 centimeters), with a short tail extending into the top part of her small intestine, according to the report. Further down in her small intestine, the doctors found another hairball, measuring 1 x 1.5 inches (4 x 3 cm), they wrote.

The small hairball may have played a role in the woman's low protein levels, the doctors wrote in the report. That hairball was found in a part of the small intestine where protein is absorbed, and therefore it may have blocked the absorption, they wrote.

The doctors were able to remove both of the hairballs, and the woman recovered from her surgery. She was advised to eat a high-protein diet as well as undergo psychiatric evaluation.

Indeed, the urge to pull out and eat one's own hair is often caused by a mental health disorder, the doctors wrote in the report. After they saw the woman, they searched for other case reports about Rapunzel syndrome.

The doctors found 88 case reports on the condition. The majority of the time, Rapunzel syndrome occurred in children and teens, and in all but five of the cases, the patients were female. Other mental health disorders were also common among the patients with the condition, they found.

Originally published on Live Science.