The study aimed to investigate the association between long-term sedentary behavior (LTSB) and depressive symptoms within a representative sample of the U.S. adult population. Data from NHANES 2017–2018 were used, encompassing information on demographics, depressive symptoms, physical activity (PA), and LTSB. Depressive symptoms were identified using the Patient Health Questionnaire (PHQ-9), with “depressive symptoms” defined as a PHQ-9 score of ≥ 5, and “moderate to severe depressive symptoms (MSDS)” defined as a PHQ-9 score of ≥ 10. PA and LTSB were assessed through the Global Physical Activity Questionnaire, where LTSB was interpreted as sedentary time ≥ 600 min. Restricted Cubic Spline (RCS) curves were utilized to observe potential nonlinear relationships. Binary Logistic regressions were conducted to analyze the associations. A total of 4728 participants (mean age 51.00 ± 17.49 years, 2310 males and 2418 females) were included in the study. Among these individuals, 1194 (25.25%) displayed depressive symptoms, with 417 (8.82%) exhibiting MSDS. RCS curves displayed increased risk of depressive symptoms with prolonged sedentary duration. Logistic regression models indicated significant associations between LTSB and depressive symptoms (OR 1.398, 95% CI 1.098–1.780), and LTSB and MSDS (OR 1.567, 95% CI 1.125–2.183), after adjusting for covariates. These findings suggest that LTSB may act as a potential risk factor for both depressive symptoms and MSDS in the studied population.