The night is dark and full of terrors. And for millions worldwide with insomnia, the most terrifying part of all is sometimes night seems like it's never going to end.

Now, in one of the largest genome-wide association studies conducted to date on insomnia, researchers say they have confirmed the condition is indeed heritable – and have discovered genetic mutations that could be responsible for the sleeplessness it brings.

Up to 20 percent of Americans are estimated to have trouble sleeping, and as bad as that is, for some it's far worse. Among US military veterans, sleeping disorders affect as much as half of those who have served, which is one reason soldiers provide a valuable cohort for research into conditions related to insomnia.

In one such new study led by psychiatrist Murray Stein from the University of California San Diego, researchers analysed data from the Army Study To Assess Risk and Resilience in Servicemembers (STARRS) – the largest study of mental health risk ever conducted among US military personnel.

As part of the project, DNA samples were obtained from over 33,000 soldiers, which Stein and his team analysed in a genome-wide association study (GWAS), to examine which genetic regions demonstrate links with insomniac traits.

Insomnia has long been thought to be a heritable condition, with research into the sleep patterns of twins suggesting as far back as decades ago the condition may have roots in DNA. But only in more recent times have GWAS investigations started to isolate what those genetic factors could be.

In the new study, the analysis indicated insomnia was linked to the existence of specific genetic mutations on chromosome 7, and in people of European descent, there were also differences on chromosome 9.

According to the team, the chromosome 7 variant is nearby a gene called AUTS2, which in previous research has also been tied to regulation of alcohol consumption, plus genes related to brain development and electric signalling involved with sleep.

"Several of these variants rest comfortably among locations and pathways already known to be related to sleep and circadian rhythms," Stein explains.

Further, among the soldiers of European lineage, there was a genetic tie between sleeplessness and major depression, and other disorders too.

"The genetic correlation between insomnia disorder and other psychiatric disorders, such as major depression, and physical disorders such as type 2 diabetes suggests a shared genetic diathesis for these commonly co-occurring phenotypes," says Stein.

"Such insomnia-associated loci may contribute to the genetic risk underlying a range of health conditions including psychiatric disorders and metabolic disease."

There's still a lot more to uncover here, but what's clear is the genetic background of insomnia is starting to emerge across multiple research projects, which isn't altogether surprising given how hugely prevalent the condition is.

The new findings build upon similar research published last year, which assessed the DNA of more than 110,000 individuals, identifying seven genes associated with insomnia risk in addition to things like anxiety, depression, neuroticism, and a low sense of wellbeing.

The immense data pool for these kind of wide-ranging examinations is only getting bigger too, with another vast GWAS studying insomnia involving an unprecedented 1.3 million individuals.

Those findings haven't yet been exhaustively peer-reviewed, but the researchers say they've identified 202 genome-wide significant loci implicating 956 genes.

Once again, these DNA variations aren't just tied to insomnia, but also to psychiatric and metabolic traits, the team explains.

According to some, even bigger studies than this lie ahead, and the kinds of insights they could provide are sorely needed, if people with insomnia around the globe ever want to get a better night's sleep.

"A better understanding of the molecular bases for insomnia will be critical for the development of new treatments," Steins explains - and millions of us are ready and eager to learn what they are.

The findings are reported in Molecular Psychiatry.