The association between dietary or plasma magnesium (Mg) with diabetes incidence and with mortality in free-living elderly was investigated. A total of 1400 participants from the Taiwanese Nutrition Survey, aged ≥ 65 years, and diabetes-free from the 1999-2000 were assessed. The dietary intake and plasma Mg concentration were obtained through 24h dietary recall and health examination at baseline. Participants were classified by quartiles (Q) of dietary Mg or by the plasma Mg normal range (0.75-0.95 mmol/L). Dietary diversity score (DDS, range 1-6) represented the dietary quality. During 8 and 10 years, 231 incident diabetes cases and 475 deaths were identified. Cox's proportional-hazards regression was used to evaluate the association between Mg and health outcomes. The hazard ratios (95% confidence interval) for death in Q2 and Q3 of Mg intakes with DDS > 4 were 0.57 (0.44-0.74) and 0.59 (0.39-0.88), respectively, compared with the lowest intake and DDS ≤ 4 participants. Participants with normal and high plasma Mg in conjunction with high DDS had relative risks of 0.58 (0.37-0.89) and 0.46 (0.25-0.85) in mortality compared with low plasma Mg and lower DDS. Optimal dietary Mg intake and plasma Mg depend on dietary quality to reduce the mortality risk in older adults.