Sleepwalkers' behavior is controlled by their DNA, claim scientists. Sufferers share a faulty chromosome, which is responsible for their behavior while asleep.
Following a study of four generations of the same family, researchers have narrowed down the variation to a section of chromosome 20.
According to their report, one copy of the defective chromosome is enough to cause sleepwalking.
Having isolated the defective section of genetic code, they hope to find new treatments for the condition.
Dr Christina Gurnett, from the Washington University School of Medicine, investigated a family in which nine out of 22 members were sleepwalkers.
One member of the family regularly awoke to found he was wearing eight pairs of socks while others suffered injuries such as broken toes due to their night wandering.
The scientists found the problem stemmed from genetic code housed on chromosome 20, and that this code had been passed down from generation to generation. Someone with the gene has a 50 per cent chance of passing it on to their children.
"It is likely that several genes will be involved. What we have found is the first genetic locus for sleepwalking," the Telegraph quoted Gurnett as telling the BBC.
"We do not know yet which of the genes in this linkage region of chromosome 20 will be responsible. Until we find the gene we won't know whether this accounts for several families or a large number of families who have sleepwalking.
"But discovering these genes could help with identifying and treating the condition."
The study has been published in the journal Neurology.