Get your exercise, but be sure to get a good night's sleep, too, if you want to lower your risk of getting cancer.

A new study suggests that regular physical activity can lower a woman's risk of developing cancer, but only if she sleeps more than seven hours a night.

The study found that women who measured in the upper 50 per cent for physical activity levels had an 80 per cent drop in overall cancer risk and a 75 per cent reduction in breast cancer risk.

However, the study also showed that women under the age of 65 who measured in the upper 50 per cent for physical activity levels but slept less than seven hours a night had a 1.5-fold increase in risk for developing cancer.

Researchers have long known that exercise can reduce overall cancer risk, but lack of sleep can have the opposite effect.

While the researchers can't say for sure how exercise lowers cancer risk, they speculated that physical activity has an impact on body functions that are linked to cancer development, such as hormone levels, immune function and body weight.

"Greater participation in physical activity has consistently been associated with reduced risk of cancer incidence at several sites, including breast and colon cancers," lead study author James McClain, cancer prevention fellow at the National Cancer Institute, said in a statement. "Short duration sleep appears to have opposing effects of physical activity on several key hormonal and metabolic parameters, which is why we looked at how it affected the exercise/cancer risk relationship."

McClain presented his study, which included data from nearly 6,000 women, at the American Association for Cancer Research's International Conference on Frontiers in Cancer Prevention Research.

The findings must be confirmed by other studies, McClain cautioned. But the study suggests that research must be done on how exactly sleep and exercise impact the development of cancer.