Lack of sleep has several negative effects on your body. But if you have diabetes, it can be particularly harmful.

A recent study has found that people who have trouble sleeping face a greater risk of dying — especially if they have diabetes.

Researchers analyzed data from nearly 500,000 middle-aged participants in the large-scale UK Biobank Study. The data was examined by experts at Chicago’s Northwestern Medicine and the University of Surrey in the U.K. The findings were published Tuesday in the Journal of Sleep Research.

Results showed that participants with diabetes who faced interrupted sleep were 87% more likely to die of any cause in the nearly nine-year study follow-up period compared to nondiabetes participants with no sleep disturbances. The causes of death include car accidents and heart attacks. Diabetes patients had a 12% greater likelihood of dying in the nine years than people with diabetes who didn’t often have sleep issues.

“If you don’t have diabetes, your sleep disturbances are still associated with an increased risk of dying, but it’s higher for those with diabetes,” corresponding study author Kristen Knutson said in a press release. She is an associate professor of neurology and preventive medicine at Northwestern University Feinberg School of Medicine.

“Although we already knew that there is a strong link between poor sleep and poor health, this illustrates the problem starkly,” said lead author Malcolm von Schantz, professor of chronobiology from the University of Surrey.

“The question asked when the participants enrolled does not necessarily distinguish between insomnia and other sleep disorders, such as sleep apnoea. Still, from a practical point of view it doesn’t matter. Doctors should take sleep problems as seriously as other risk factors and work with their patients on reducing and mitigating their overall risk,” he added.

Most of the study’s participants had Type 2 diabetes, the most common form. Some had Type 1 diabetes.

Previous studies have shown the link between sleeping issues and diabetes.

A 2016 study found that sleeping for less than six hours at night was associated with Type 2 diabetes. Another study found that people who reported five hours or less of sleep had more than twice the odds of prediabetes. This was compared to people who got 7 hours of sleep.