Losing weight and exercise can lower your risk of type 2 diabetes. But getting more magnesium may help, too.

In a recent study, scientists tracked roughly 200,000 men and women for 28 years. Those who reported getting the most magnesium from their food and supplements had a 15 percent lower risk of type 2 diabetes than those who reported getting the least.

How much magnesium the study participants consumed

Women in the “most” category typically got about 410 milligrams of magnesium a day. That’s well over the Recommended Dietary Allowance for women over 30 (320 mg). Men got about 470 mg a day, also higher than their RDA (420 mg).

But something else about people who eat more magnesium could explain why they have a lower risk of diabetes. So scientists do trials to see if giving people magnesium lowers their blood sugar or insulin.

What magnesium trials have found

“In some studies on people who have metabolic syndrome or prediabetes, magnesium lowers fasting blood glucose or insulin or HbA1c,” notes Adela Hruby, a research fellow at the T.H. Chan Harvard School of Public Health. (Hemoglobin A1c is a long-term measure of blood sugar levels.)

But not all studies agree. What’s more, “there haven’t been sufficient numbers of trials in humans,” says Hruby.

How might magnesium help prevent diabetes?

"It might help beta-cells in the pancreas secrete insulin,” says Hruby. “And it may also make cells more sensitive to insulin, so that your muscles and other tissues respond better to it.”

Where to get magnesium

Most magnesium-rich foods—like green leafy vegetables, beans, nuts, and whole grains—are healthy. And you’re better off getting your magnesium from whole foods than from supplements because getting more than 350 mg a day from pills may cause diarrhea.

“You can’t get too much magnesium from foods,” adds Hruby.

What’s more, if it’s not magnesium but something else in beans, leafy greens, and whole grains that protects your health, you won’t get it from a pill.

What to do

These studies aren’t proof that magnesium can lower the risk of diabetes, but they're one more reason to eat more magnesium-rich foods.