Eating a diet rich in vitamin D and calcium may lower the risk of experiencing early menopause, according to new research.

In their study, researchers from the University of Massachusetts Amherst, found that participants who consumed the most amount of vitamin D (from food, not supplements) were 17 percent less likely to undergo early menopause, when compared to subjects who ate the least amount of vitamin D.

Read: Early Onset Menopause: How Age Impacts Risk For Heart Disease, Premature Death

“Laboratory evidence relating vitamin D to some of the hormonal mechanisms involved in ovarian aging provided the foundation for our hypothesis,” said study author Alexandra Purdue-Smithe, in a statement. “However, to our knowledge, no prior epidemiologic studies have explicitly evaluated how vitamin D and calcium intake me be related to risk of early menopause.”

Their findings showed that calcium had a slightly less significant effect on early menopause than vitamin D. They found that participants who had the most amount of calcium in their diet were 13 percent less likely to undergo early menopause, when compared to participants who consumed the least amount of calcium.

The team of epidemiologists studied data from over 116,400 female nurses in the United States, who were part of the Nurses' Health Study II. All of the nurses were between 25 and 42 years old when they responded to the original questionnaire in 1989. Every two years after the original survey, they were asked about various lifestyle behaviors and medical conditions. Additionally, on five occasions, their food intake was assessed, which allowed the researchers to study any changes in their diet.

The researchers explained that a high intake of vitamin D and calcium may contribute to overall better health, therefore it was necessary for them to consider other factors, such as their body mass index, and how often the person smoked or drank alcohol.

“Adjusting for these factors made almost no difference in our estimates,” said Purdue-Smith.

Read: A Short Guide To Reading A Milk Label: Fat Content, Lactose, Or Raw, Plus Other Terms On The Carton

The team also examined the effect of vitamin D and calcium consumed from dairy versus non-dairy foods, and only found a significant effect for dairy foods. Purdue-Smith plans to conduct further research on individual dairy foods to better understand how they might be associated with early menopause.

If a woman experiences menopause before the age of 40, it’s considered early. This can happen simply on its own, or due to medical treatments. A couple of these treatments include pelvic radiation treatments for cancer, and surgery to remove the ovaries or uterus. Some possible causes of it happening on its own may be due to chromosome defects, genetics, or autoimmune diseases, according to the U.S. Office on Women’s Health.

“Early menopause can have profound psychological and financial implications for couples who are unable to conceive as they wish. As such, it is important to identify modifiable risk factors for early menopause, such as diet,” said Purdue-Smith.

See also: Early Menopause Shows Higher Risk Of Heart Failure, Especially In Smokers

Hormone Therapy For Symptoms Of Menopause: Women Who Take Estrogen Pills Early On May Protect Against Heart Disease