BackgroundLimited understanding exists regarding the associations of traffic-related pollution with depression and anxiety symptoms in individuals residing within low- and middle-income countries. MethodsData for this study were extracted from the Psychology and Behavior Investigation of Chinese Residents (PBICR) survey, implemented between June 20 and August 31, 2023. We determined residential proximity to major roadways through self-reports and evaluated depression symptoms using the Patient Health Questionnaire-9 (PHQ-9), along with anxiety symptoms assessed through the Generalized Anxiety Disorder-7 (GAD-7). We examined the associations between residential proximity to major roadways and depression and anxiety symptoms using logistic regressions and generalized linear models, while controlling for potential confounding variables. ResultsThis study comprised a total of 22,723 participants. The adjusted odds ratios (OR) for depression symptoms were 1.34 (95 % confidence interval (CI) 1.20, 1.51), 1.29 (95 % CI 1.17, 1.43), 1.34 (95 % CI 1.20, 1.49), and 1.32 (95 % CI 1.17, 1.49) among individuals residing within <50 m, 50–100 m, 101–200 m, and 201–300 m, respectively, in comparison to those residing >300 m from a major roadway. Individuals residing <50 m, 50–100 m, 101–200 m, and 201–300 m from a major roadway exhibited adjusted OR for anxiety symptoms of 1.49 (95 % CI 1.30, 1.69), 1.21 (95 % CI 1.07, 1.37), 1.38 (95 % CI 1.21, 1.56), and 1.38 (95 % CI 1.20, 1.59), respectively, in contrast to those residing >300 m. ConclusionsThis study provides valuable insights into the associations between environmental factors and mental health. The findings underscore the importance of integrating environmental considerations into comprehensive mental health frameworks, especially for individuals residing near high-traffic areas.