Treating young people who suffer from insomnia may reduce anxiety and depression, according to researchers at Oxford University’s Sleep and Circadian Neuroscience Institute.

The Huffington Post reports that using online cognitive behavioral therapy (CBT) could be the key to treating such debilitating mental health problems.

Researchers at the institution also found that successfully treating sleep disruption eased psychotic symptoms such as hallucinations and paranoia.

“Sleep problems are very common in people with mental health disorders, but for too long insomnia has been trivialized as merely a symptom, rather than a cause, of psychological difficulties,” said Daniel Freeman, a professor of clinical psychology who led the work. “This study turns that old idea on its head, showing that insomnia may actually be a contributory cause of mental health problems.”

The research is based on data collected from 3,755 university students from across Britain who were randomly placed into two groups. One group had six 20-minute sessions of online CBT that was delivered via a digital program called Sleepio. The others were exposed to standard treatments but not CBT.

The researchers found that those who had the CBT sleep treatment reduced their insomnia significantly. They also showed small but sustained reductions in paranoia and hallucinatory experiences.

The CBT led to improvements in depression, anxiety, nightmares, psychological well-being, and daytime work and home functioning, the researchers said.

“A good night’s sleep really can make a difference to people’s psychological health,” Daniel Freeman, a professor of clinical psychology. “Helping people get better sleep could be an important first step in tackling many psychological and emotional problems.”