According to the study from the U.S. National Cancer Institute, these trends were also observed for endometrial cancer as well.

Long-term use of the pill was linked to reductions in risk for both cancers, and this was "generally consistent across health behaviors," according to a team led by Kara Michels, a cancer institute epidemiologist.

The researchers looked at data from a U.S. study that tracked the health of women from 1995 to 2011. At least 100,000 of the women said they were using an oral contraceptive at the beginning of the study.

Michels' group found a 40 percent reduction in the risk of ovarian cancer for women who used the pill for 10 years or more. Furthermore, that benefit was similar for smokers and nonsmokers, and for slim and heavier women, the investigators noted.

As for endometrial cancers -- tumors of the uterine lining -- the benefit was even greater for women with less healthy lifestyle habits.

For example, women who smoked experienced a 53 percent drop in risk for endometrial cancer while on an oral contraceptive. And obese women who were on the pill saw an even greater benefit -- a 64 percent reduction in risk for endometrial cancers, the team reported.

However, long-term use of the pill appeared to have no effect on a woman's odds for either breast or colon cancers.

Just how might hormonal contraception shield women from ovarian and endometrial tumors? According to Michels' group, because the pill supplies its own dose of one hormone, progestin, long-term use might then trigger a reduction in a second hormone, estradiol, "across the menstrual cycle."

Exposure to such hormones has been linked to raised rates of certain cancers.

One cancer specialist who reviewed the findings said they expand on existing research.

"This study confirms that long-term use [of the pill] causes a profound reduction in the risk of ovarian and endometrial cancers," said Dr. Stephen Rubin, chief of gynecologic oncology at Fox Chase Cancer Center in Philadelphia.

Ovarian cancer is a "silent killer" because it is often detected only in its later stages. According to the American Cancer Society, more than 22,000 U.S. women will receive a diagnosis of the disease in 2018, and it will claim more than 14,000 lives.

Endometrial cancer is less lethal, but more common. According to the cancer society, more than 63,000 women will be diagnosed with such tumors this year, while about 11,000 will die from the disease.