People with high or low magnesium levels are 30 per cent more likely to develop debilitating symptoms.
But doctors could identify the levels in regular blood tests and help people adjust their diets to slash the risks.
The hopes follow a Dutch study which monitored thousands of people for links between magnesium and the condition.
Study author Brenda Kieboom, of Erasmus University Medical Centre in Rotterdam, said: “If our results are confirmed, magnesium would be an easy way to lower your risk of dementia and hopefully prevent people from getting it at all.
“Optimising magnesium levels is fairly easy and can be achieved by diet, supplements or drugs in cases of a severe deficiency.”
Diets high in green leafy vegetables, nuts and whole grains help people maintain normal magnesium levels.
Ms Kieboom added: “These results need to be confirmed with additional studies but the results are intriguing.
“Since current treatment and prevention options for dementia are limited, we urgently need to identify new risk factors that could potentially be adjusted.
“If people could reduce their risk through diet or supplements that could be very beneficial.”
The study found that of 1,771 participants with low magnesium 160 developed dementia – a rate of 10.2 per 1,000 every year. Of 1,748 people with high levels, 179 were affected, a rate of 11.4 per 1,000.
In the middle group, 102 of 1,387 developed dementia – a rate of 7.8.
Meanwhile researchers in the UK are ploughing an extra £2million into four dementia prevention projects.
A study at the University of Manchester and Goldsmiths, University of London, is to receive £246,000 to develop techniques to identify dementia risks based on medical records.
Nearly £800,000 will go on investigating whether internet counselling would help people make a healthy lifestyle choice.
More than £760,000 will go towards encouraging a Mediterranean diet and £194,000 will be used to probe links between hearing loss and dementia.
Dr David Reynolds, of Alzheimer’s Research UK said: “While scientists continue to make progress towards more effective dementia treatments, it is crucial that we also explore ways people can reduce their risk of developing it in the first place.
“We are delighted to be able to invest over £2million into these four innovative projects.
“Without new ways to help one in three children born today will die with dementia.”