Stephanie Watson, Executive Editor, Harvard Women’s Health Watch

Walking, dancing, running, even Zumba-ing every day appears to reduce a woman’s risk of developing breast cancer, according to a study published online in the journal Cancer. The type or intensity of the exercise didn’t seem to matter, as long as it was done often. But overeaters be warned: gaining weight seems to cancel out the breast-cancer benefits of this hard work.

How much exercise is needed to lower breast cancer risk? In this study of 3,000 women, 10 to 19 hours a week (about two hours a day) had the greatest benefit. Women who worked out that much had a breast cancer risk about 30% lower than that of inactive women. The intensity of the workout didn’t matter in this study—walking, jogging, and running yielded the same benefit.

Age didn’t seem to matter, either. Physical activity reduced breast cancer risk in younger women during their reproductive years and older women after menopause. “The observation of a reduced risk of breast cancer for women who engaged in exercise after menopause is particularly encouraging given the late age of onset for breast cancer,” study author Lauren McCullough of the University of North Carolina Gillings School of Global Public Health said in a statement.

What did make a difference in the effect of exercise was weight gain—especially after menopause. Gaining a significant amount of weight essentially wiped out the benefits of exercise on breast cancer risk in older women.

The researchers did this study by comparing exercise habits in 1,504 women with breast cancer and about the same number without it. Because the women weren’t assigned to different interventions (like exercising vs. staying sedentary), it can’t confirm that exercise reduces breast cancer risk. At this point, the link is just an association.

What this study does do is give women of every age another reason to lace up their sneakers and get moving. “Exercise fights obesity, combats heart disease and diabetes, improves mood and memory, strengthens bones, and possibly prevents breast cancer,” says Celeste Robb-Nicholson, assistant professor of medicine at Harvard Medical School and editor in chief of Harvard Women’s Health Watch. “Exercise is the prescription I like to write most often for women.”