Objectives : The objective of this study was to determine the effects of dietary magnesium supplementation on mental health in elderly individuals with insomnia. Method: A double-blind randomized clinical trial was conducted on 46 elderly subjects with insomnia randomly allocated to the magnesium or placebo (control) group. The groups received either 500 mg elemental magnesium or placebo, respectively, daily for eight weeks. General Health Questionnaire-28 (GHQ-28) and Insomnia Severity Index (ISI) were conducted at baseline and at the end of the intervention period. Serum magnesium and cortisol levels were also determined in the participants. In addition, information was obtained on anthropometric confounding factors and daily intake of magnesium, calcium, potassium and caffeine using the 24-hour Recall Questionnaire. The “Nutritionist 4” software was used for nutritional analysis. Statistical analysis was done using paired t-test to compare within-groups differences and Student's t-test to compare between-groups differences. Results: No significant differences were observed in the assessed variables between groups at baseline. Compared to the placebo group, dietary magnesium supplementation in the experimental group brought about statistically significant decreases in total GHQ-28 score (p=0.01), somatic symptoms (p=0.04), anxiety/insomnia symptoms (p=0.02), depression symptoms (p=0.001), Insomnia Severity Index (p=0.006), and serum cortisol concentration (p=0.008). Conclusion: Magnesium supplementation can affect some indices of mental health and insomnia and may hence result in improvements in general mental health in elderly people with insomnia.