IntroductionA higher risk for depression and mortality is associated with the inflammatory potential of diet measured through the Dietary Inflammatory Index (DII). The roles of DII in the risk of depression and death in cancer survivors were unclear. We aimed to examine the association between energy-adjusted DII (E-DII) score and risk of depression, and mortality using data from the 2007–2018 National Health and Nutrition Examination Survey (NHANES), with a special focus on cancer survivors.MethodsThe 24-h dietary recall interview was used as a basis to calculate the E-DII score and the Patient Health Questionnaire-9 (PHQ-9) was used to measure the depressive outcomes. Logistic regression analyses were performed to determine the association between quartiles of E-DII score and depression. Cox proportional hazard regression and competing risk analyses were used to estimate the risks of quartiles of E-DII score or depression on mortality.ResultsA total of 27,447 participants were included; including 24,694 subjects without cancer and 2,753 cancer survivors. The E-DII score and depression were not distributed differently between the two groups. However, the E-DII scores were positively associated with within each group’s depression (all P trend < 0.001) and participants with higher E-DII scores had a higher risk of depression (subjects without cancer: ORQ4vsQ1: 2.17, 95% CI: 1.75–2.70; cancer survivors: ORQ4vsQ1: 1.78, 95% CI: 1.09–2.92). The median follow-up time were 87 person-months, a total of 1,701 (4.8%) and 570 (15.2%) all-cause deaths in subjects without cancer and cancer survivors were identified by the end of 2019. The highest E-DII scores quartile was associated with the highest risk of all-cause (HRQ4vsQ1: 1.90, 95% CI: 1.54–2.35) and cardiovascular disease (CVD) cause death (HRQ4vsQ1: 2.50, 95% CI: 1.69–2.3.7) in the subjects without cancer. Moreover, participants with depressive symptoms had higher all-cause mortality (HR: 1.29, 95% CI: 1.04–1.59). No significant correlation was found for E-DII scores or depression with all-cause, cancer-cause or CVD-cause mortality in cancer survivors.ConclusionOur findings demonstrate that E-DII score was positively associated with depression risk. A higher E-DII score or depressive symptom may increase the risks of all-cause and CVD-cause mortality only among general subjects.