People who have been diagnosed with sleep apnea or have trouble sleeping deeply may be at more risk of developing dementia, a new study suggests.

The study, published Wednesday in the journal of American Academy of Neurology, found people who don’t have reduced oxygen in their blood during sleep— a sign of sleep apnea and other conditions such as emphysema— are more likely to have abnormalities in their brain tissue. The abnormalities, called micro-infracts, are associated with dementia.

“[Micro-infractions are] very small strokes that have been correlated with memory loss and thinking-skill problems in aging,” said the Cleveland Clinic’s Dr. James Leverenz, who did not participate in the study but treats dementia patients.

The study analyzed 167 Japanese-American men with an average age of 84 until their death, which was about six years later. Autopsies were conducted on their brains to look for signs associated with dementia and Alzheimer’s disease, like loss of brain cells, micro infarcts, plaques and tangles and Lewy bodies found in Lewy body dementia.

The men were divided into four groups based on percentage of time spent with lower-than-normal blood oxygen levels during sleep, with the highest group spending 72 to 99 percent of the night with low levels, according to a news release. The lowest group only spent 13 percent of their time with low oxygen levels. The researchers found the men in the highest group were nearly four times more likely to have brain damage that the lowest group.

The researchers also concluded that people who spent less time in deep sleep were more likely to have a loss of brain cells compared to people who spent more time in deep sleep, also called slow wave sleep. According to a news release on the study, as people age they tend to spend less time in slow wave sleep, which is critical in processing new memories and facts. A loss of brain cells is a hallmark trait of Alzheimer’s disease and dementia.

“These findings suggest that low blood oxygen levels and reduced slow wave sleep may contribute to the process that lead to cognitive decline and dementia,” said study author Dr. Rebecca Gelber of the VA Pacific Islands Health Care System and Pacific Health research and Education Institute in Honolulu, Hawaii.

“More research is needed to determine how slow wave sleep may play a restorative role in brain function and whether preventing low blood oxygen levels may reduce the risk of dementia,” Gelber said.

Gelber noted that a previous study showed a sleep apnea breathing machine may help improve cognition in patients who have already developed dementia.

“Your spouse or your bed partner is telling you that you’re snoring very loudly, or it seems that you stop breathing at certain points during your sleep or you’re just having a lot of fatigue during the day; it’s work going to see your physician and getting your sleep evaluated because if you do have true sleep apnea it’s not good for your brain,” Leverenz said in a separate news release on the study.