A good night's sleep is important for your long-term health, according to a recent study.

Researchers at the University of Copenhagen found that sleep affects lifestyle factors, so it's important that people get enough of it.

"This study shows that sleep affects our ability to maintain a healthy lifestyle, and when sleep deteriorates we are more likely to make unhealthy lifestyle changes," researcher Alice Jessie Clark said in a statement.

For the study, researchers collected and analyzed data from 35,000 adult Finns.

They found that that maintaining a good night's sleep made it easier to maintain a healthy lifestyle. For example; they found that smokers who maintained a sleeping pattern characterized by normal sleep duration and undisturbed nights were less likely to still be smoking and more likely to have quit smoking four years on, when compared to those who either shortened their average sleep duration or experienced an increase in sleep disturbances.

Overall, similar patterns were also observed in regards to other adverse lifestyle changes.

"Better knowledge of the importance of sleep, not just for biological restitution, but also for making healthy lifestyle decisions, may help people make informed decisions about prioritizing how to spend the night -- catching up on work emails, surfing social media or going to bed and ensuring a good night's sleep," Clark concluded.

The findings are detailed in the International Journal of Epidemiology.