Introduction: This study investigated this association and the role of BMI in the inflammatory process in a large population-based observational study.Methods: A total of 1,865 elderly people (≥55 years) were followed from the Community Cohort Study of Nervous System Diseases (CCSNSD) cohort study from 2018 to 2019 (Mean [SD] age, 66.31 [0.32] years; 716 [38.4%] males). The semi-quantitative FFQ and geriatric depression scale (GDS) were used to evaluate the diet and depressive symptoms of the elderly, respectively. The multivariable logistic regression model estimated the OR and 95% CI between Empirical Dietary Inflammatory Index (E-DII) and depression. The interaction of E-DII and BMI on depressive events was tested, and the mediation analysis of BMI was performed.Results: As measured by E-DII, the mean (SE) value of the inflammatory potential of the diet in our study was 1.56 (0.12). E-DII ranged from 5.23 to 5.58. In comparison with the first quartile, the elderly from the second quartile (OR: 1.15 [95% CI: 1.09, 1.28]) to the fourth quartile (OR: 1.31 [95% CI: 1.16, 1.42]) have a higher risk of depression before adjustment for BMI. An interaction was observed between E-DII and BMI in terms of the risk of depression (PInteraction < 0.001). The whole related part is mediated by BMI (31.06%).Conclusion: Our findings indicate that the higher pro-inflammatory potential of diet is associated with a higher risk of depression, and this association may be mediated by BMI. Further research is needed to verify our findings and clarify the latent mechanism.