Abstract Objectives Lifetime prevalence of depression in America is 5% among men and 10% among women, with slightly higher rates among premenopausal women. Diet and inflammation are associated with depression. We assessed the mediating role (indirect effect) of inflammation on the association of DII and depression (total effect). Methods We used observations from 3 cycles of the NHANES database (N = 10,022). Diet was measured using 24-hour dietary recalls. We used DII to assess inflammatory potential of diet and categorized it into quartiles (Q1, Q2, Q3, Q4). Continuous and major depression were defined using the Patient Health Questionnaire (PHQ-9). Systemic inflammation was measured by C-reactive protein (CRP) levels. Our multivariable model was adjusted for age, sex, race, BMI, waist circumference, smoking, diabetes, marital status, education, socioeconomic status, and physical activity. We used structural equation modeling to assess the mediation effect of CRP. Results When comparing Q4 of DII to Q1 in the fully adjusted model, of the 0.55 unit increase in depression (95% CI 0.99–1.44, P < 0.001) only 0.02 units (95% CI 0.006–0.03, P = 0.005) were explained by the indirect effect of CRP. The mediation results were not significant in the sex stratified models. After stratifying our population by menopausal status, when comparing Q4 to Q1, the odds ratio for having major depression in premenopausal women was 6.37 (95% CI 2.27–17.92, P < 0.001) and in postmenopausal women was 2.16 (95% CI 1.09–4.28, P = 0.027). No indirect effect of CRP was observed. Conclusions An anti-inflammatory diet may be effective in lowering the odds of experiencing major depression among premenopausal women, independent of its effect on systemic inflammation. Although our findings suggest a significant mediation role of CRP on the association of DII and depression, we do not believe the indirect association was biologically meaningful. As this was a cross-sectional study, future longitudinal studies should focus on lifetime dietary intake and confirm the temporality of association between DII and depression. Funding Sources None.