Abstract Emerging evidence in North America and Europe suggests that traffic-related air pollution (TRAP) adversely affects cognition. However, little is known about this relationship in people living in low- and middle-income countries (LMICs). It is also unknown whether indoor air pollution can modify the effect of TRAP. We derived data from the Chinese Longitudinal Healthy Longevity Survey (CLHLS), a prospective cohort study, including 11,187 individuals of 82.0 years old (53.9% female). We ascertained residential proximity to major roadways based on self-reports and assessed cognitive function using the Mini-Mental State Examination (MMSE). We used cooking fuel type and home ventilation as proxies for indoor air pollution. We examined the associations between major road proximity and cognitive impairment using multivariable logistic regressions, controlling for demographic, lifestyle, socioeconomic status, and chronic conditions. We did subgroup analyses and assessed the potential interaction effect. The prevalence of cognitive impairment was 33.4%. The adjusted odds ratios of cognitive impairment were 1.20 (1.05, 1.35), 1.26 (1.09, 1.46), 0.99 (0.84, 1.17), and 1.05 (0.88, 1.25) for individuals living 300 m from a major roadway. In dichotomized analyses, the risk (OR) associated with living closer to roadways was greater in participants who did not implement any ventilation during cooking (compared to those using natural or mechanical ventilation, 1.86 [1.31–2.65] vs. 1.16 [1.03–1.26], P for interaction = 0.001) and in solid fuel users (compared to clean fuel users, 1.37 [1.13–1.67] vs. 1.13 [1.04–1.21], P for interaction = 0.028). The associations were robust in a set of sensitivity analyses. The results suggested that living closer to major roadways was associated with an increased risk for cognitive impairment in older adults in China, indicating an adverse TRAP effect. Indoor air pollution appeared to enhance the TRAP effect synergistically.