Poor sleep quality may be linked to shrinkage of the brain's gray matter over time, according to a recent study.

Researchers found that older adults who had poor sleep quality saw faster deterioration in three parts of their brain. These sleep difficulties included "having trouble falling asleep, waking up during the night or waking up too early," HealthDay reported.

However, researcher say it is not clear whether poor sleep quality causes the brain to shrink, or vice versa.

"This is a really important finding because we are trying to find out what the purpose of sleep is, and why it is important that we get sleep," Claire Sexton, lead author of the study and Oxford researcher told CTV News. "We found sleep problems were related to rate decline in some areas of the brain."

For the study, researchers collected data from 147 adults of various ages over several years.

Study participants had MRI brain scans 3.5 years apart, in addition to completing a questionnaire that looked at how long people slept, how long it took them to fall asleep and if they used any sleeping medications.

Sexton and her team found that participants who had sleep problems showed more rapid decline in widespread areas of the brain. The findings were worse for those 60 years or older.

"Poor sleep quality was associated with reduced volume within the superior frontal cortex and a greater rate of atrophy across the frontal, temporal, and parietal cortices," researchers said in the study.

However, Sexton said it may be the other way around. It is just as likely that the deterioration in the brain also contributes to difficulty sleeping.

"What this study signals to me is that [good bedtime habits] and good sleep matters," said Anton Porsteinsson, director of Alzheimer's disease care, research and education at the University of Rochester School of Medicine and Dentistry in New York. "Whether that has to be natural sleep or whether we can use medications to enhance sleep has not been answered, but it's probably best to improve your natural sleep patterns."

To improve sleep, Sexton recommended having a bedtime routine and going to bed at the same time each night.

The findings were recently published in the journal Neurology.