The long-term use of oral contraceptives reduces the risk for ovarian and endometrial cancers, and the effect is especially evident in smokers, the obese and those who exercise infrequently, a new study found.

Earlier studies have demonstrated an association of previous oral contraceptive use with reduced risk for these cancers in postmenopausal women. This study considered the impact of various health and lifestyle factors, including smoking, obesity and physical activity.

The study, in JAMA Oncology, included 196,536 women ages 50 to 71, more than half of whom had used oral contraceptives.

Compared with those who hadn’t used oral contraceptives, those who had used them for 10 years or more had a 34 percent reduced risk for endometrial cancer, with the strongest reductions among women who were smokers or obese at the start of the study. Contraceptive users had a 40 percent risk reduction for ovarian cancer, with the risk reduction significant in smokers, the obese and those who got no regular exercise.