Three interlinked genes may explain why some children have hair that simply cannot be brushed or combed.
Scientists have untangled the genetic roots of the rare condition, known as "uncombable hair syndrome", or in German "Struwwelpeter" (Shock-headed Peter) syndrome.
Affected children have extremely frizzy, dry, generally light blonde hair, with a characteristic shine.
While many children have difficult hair, the parents of those with the disorder face a battle they cannot hope to win.
The symptoms are most pronounced in childhood and diminish over time, so that the hair is much more manageable in adulthood,
Scientists first described the condition in 1973, and since then only around 100 cases have been recorded worldwide.
Professor Regina Betz, a hair specialist from the University of Bonn, who led the new study, said: "We assume that there are much more people affected.
"Those who suffer from uncombable hair do not necessarily seek help for this from a doctor or hospital."
Her team of German and French scientists tracked down nine children with uncombable hair syndrome from around the world and mapped their DNA.
They discovered that the children had mutations in three specific hair growth genes, PADI3, TGM3 and TCHH. The first two contain assembly instructions for enzymes while TCHH codes for an important hair shaft protein.
All three mutant genes work together to create an unruly nest of knots and tangles.
"From the mutations found, a huge amount can be learned about the mechanisms involved in forming healthy hair, and why disorders sometimes occur," said Prof Betz, whose work is published in the American Journal of Human Genetics.
"At the same time, we can now secure the clinical diagnosis of 'uncombable hair' with molecular genetic methods."
:: Shock-headed Peter, who never brushed his hair or cut his nails, is a character from the popular German children's book Der Struwwelpeter by Heinrich Hoffman. The book consists of a series of morality tails describing the sometimes horrific fate of children who commit sins such as thumb-sucking or playing with matches.