Background: Mental health has become a major public health issue worldwide. Biological and epidemiological studies suggest diet has a role in the prevention or cure of mental disorders. However, further research is required to elucidate the relationship between diet and mental health. This study aimed to investigate associations between dietary intake of nutrients (macronutrients, vitamins, calcium, and fatty acids) and food groups (fish, meat and chicken, dairy products, and vegetables) and mental health among middle-aged Japanese in cross-sectional and prospective studies. Methods: In total, 9298 men and women that participated in two areas of the Japan Multi-Institutional Collaborative Cohort Study were eligible for analysis at the baseline (cross-sectional) survey. Of these, 4701 participants were followed for about 5 years and included in the follow-up (prospective) analysis. The 12-item General Health Questionnaire (GHQ) was used to assess participants' general mental health status over the past several weeks. The average intake of 46 foods over the past year was assessed by a validated food frequency questionnaire. We also evaluated lifestyle and medical factors using a self-administered questionnaire. A cross-sectional logistic regression analysis was performed to estimate odds ratios for a GHQ score ≥ 4 (poor mental health) according to dietary intake of foods/nutrients at baseline. The prospective study used baseline dietary and lifestyle factors and GHQ scores at follow-up. Results: The cross-sectional logistic regression analysis showed vegetables, protein, calcium, vitamin D, carotene and n-3 highly-polyunsaturated fatty acids were inversely associated with a GHQ score ≥ 4. On the other hand, mono-unsaturated fatty acids showed a positive association with higher GHQ score. The prospective logistic regression analysis found dairy products, calcium, vitamin B 2 , and saturated fatty acids were inversely correlated with a GHQ score ≥ 4. Calcium was associated with GHQ scores in both the cross-sectional and follow-up studies. In the follow-up study, the multivariableadjusted odds ratio for a GHQ score ≥ 4 was 0.71 (95% confidence interval, 0.55-0.92) for the highest versus lowest quartiles of calorie-adjusted dietary calcium intake. Conclusion: Consuming particular nutrients and foods, especially calcium and dairy products, may lead to better mental health in Japanese adults.