Long-term exposure to air pollutants is likely to be associated with mental disorders, but relevant studies remain limited and inconsistent, and evidence to assess causality is particularly lacking, especially in developing countries. In addition, there are few studies on the role of physical activity in this relationship. We investigated the causal relationship between air pollutant exposure and mental health among Chinese adults and whether physical activity could play a positive role in this relationship.Using the balanced panel data for 2014 and 2016 from the China Family Panel Study, a representative Chinese national cohort study, we selected and validated appropriate instrumental variable to explore the causal relationship between air pollution and mental health and explored the moderating effect of physical activity using an instrumental variable fixed effects model (IVFE) in a counterfactual causal inference framework. PM2.5 and ground surface ozone were selected as proxies for different types of air pollutants and extended the interpretability by studying them for populations with different characteristics.A total of 21,944 participants were included in this study. In the IVFE model, we found that both PM2.5 and ground surface ozone significantly negatively affected mental health, and that habitual physical activity counteracted this negative effect regardless of different types of air pollution. We also found that the findings held for adults with different characteristics.The findings suggest that habitual physical activity may offset the deterioration of mental health in adults in developing countries due to air pollution, regardless of age, gender, income, and the presence of chronic diseases.