Around the world, people are living longer. There are more older people and more people with dementia. One way to reduce the chance of developing dementia, a study has found, is to take a vitamin D supplement.

Dementia is not an inevitable consequence of aging. As many as 40 percent of cases could be delayed, perhaps even prevented, with diet and lifestyle. Eating healthy, not smoking, exercising, getting sufficient sleep, and managing blood pressure, blood sugar and weight all help to lower the risk.

Past studies have suggested that insufficient vitamin D may be linked to a higher risk of dementia. The vitamin appears to play a role in preventing a build-up of tau and amyloid proteins in the brain. Accumulations of amyloid is a sign of Alzheimer’s disease.

Vitamin D supplements benefited all the groups in the study and led to living longer without dementia; but the vitamin provided more protection from dementia to women than to men.

Vitamin D is a nutrient that is sometimes hard for older people to get in adequate quantities. The only foods that contain significant amounts include fatty fish, fish oils, beef liver and foods fortified with vitamin D such as milk or many cereals.

Sunshine is the primary source of vitamin D, and many older people can’t or don’t spend enough time outside. The body’s ability to make vitamin D from sunshine diminishes with age, as well.

Researchers at the University of Calgary’s Hotchkiss Brain Institute in Canada and the University of Exeter in the UK looked for a connection between dementia and vitamin D supplementation using data from over 12,000 participants in the US National Alzheimer’s Coordinating Center. The average age of the participants was 71, and none had dementia when they began participating in the study. Thirty-seven percent of the people in the study were taking a vitamin D supplement.

Taking vitamin D made a big difference. Diagnoses of dementia were over 40 percent lower among those taking vitamin D supplements. Over 10 years, more than 2,600 people in the study went on to be diagnosed with dementia. Three-quarters of those diagnosed had not taken vitamin D supplements.

The supplements benefited all the groups in the study and led to living longer without dementia; but the vitamin provided more protection from dementia to women than to men. A greater effect was also seen in people with normal cognition compared to those who had mild cognitive impairment.

Sunshine is the primary source of vitamin D, and many older people can’t or don’t spend enough time outside.

People who carry the APOE4 gene have a higher risk of Alzheimer’s dementia. The effect of vitamin D supplementation was higher among those who did not carry that gene, and the researchers think it may be that people who carry that gene absorb vitamin D better, lowering the effect of supplemental vitamin D. No bloodwork was drawn to test that hypothesis, however.

“We know that vitamin D has some effects in the brain that could have implications for reducing dementia, however so far, research has yielded conflicting results,” lead researcher, Zahinoor Ismail, of the University of Calgary and University of Exeter, said in a statement. “Our findings give key insights into groups who might be specifically targeted for vitamin D supplementation. Overall, we found evidence to suggest that earlier supplementation might be particularly beneficial, before the onset of cognitive decline.”

Many people already take supplemental vitamin D for various health reasons. If you are concerned about reducing your risk of dementia, talk to your healthcare provider about the appropriate dose for you.

You can take too much vitamin D. High levels of vitamin D can lead to hypercalcemia — too much calcium in your blood— which is responsible for most of the symptoms of vitamin D toxicity: nausea, vomiting, headache, anorexia, metallic taste, constipation, frequent urination. Elevated calcium over a long period of time can lead to vascular and tissue calcification and pancreatitis.

The study is published in Alzheimer's & Dementia: Diagnosis, Assessment & Disease Monitoring.