Abstract:Objective This research utilizes data from the National Health and Nutrition Examination Survey (NHANES) spanning from 2005 to 2018 to investigate the association of dietary inflammation and sleep disorders with depression. Methods The study encompassed 19,763 qualified participants. Logistic regression models were employed to assess the association of dietary inflammation and depression, among which the mediating function of sleep disorder was analyzed. Data were managed and interpreted using IBM SPSS 25.0 and R 4.3.2 software. Results When adjusting for various factors such as age, gender, race, BMI, total energy consumption, alcohol use, smoking habits, and physical exercise, the risk of depression in the pro-inflammatory diet exposure group is higher (OR = 1.55, 95%CI = 1.37-1.76, P< 0.001). In group with sleep disorders, the depression risk is also obviously higher (OR = 4.88, 95%CI = 4.40-5.43, P< 0.001). The risk of developing into depression when exposed to both pro-inflammatory diet and sleep disorders is 7.75 times as to the group with neither exposure. Sleep disorders have mediated the relationship between dietary inflammation and depression (β=0.64, 95%CI = 0.54-0.74, P<0.001). Conclusion People following a proinflammatory diet face an increased risk of developing into depression, and sleep disorders act as a significant mediator in the relationship between dietary inflammation and depression.