Few studies have explored the relationship between air pollution and settlement intention. In this study, we fill the gap by investigating the impact of air pollution on migrants' settlement intention and analyzing its heterogeneous effect and potential mechanisms. We find migrants are more likely to settle down in cities with clean air than in those with dirty air. The results are consistent when different air quality indices are used and the endogeneity problem is mitigated using thermal inversion as an instrument for air quality. Heterogeneity analyses show that low-SES (social economic status) migrants are more likely to migrate out due to polluted air. The mechanisms results show that air quality may affect the long-term settlement intention of migrants through two channels: the direct subjective attitude effect and indirect health effect. In addition, we also find that air pollution only affects migrants' permanent settlement intention, while it has no impact on their short-run stay intention. Our results shed light on air pollution as an important contributor to migrants' migration and settlement choice and as a determinant in discussions on cities’ brain drain. • Explore the links between air pollution and migrant workers' permanent settlement intention. • Use temperature inversion strength as an instrument for air quality. • Severe air pollution negatively affects migrant workers' intention to settle down permanently in the city, while it has no impact on their short-run stay intention. • Low-SES migrants and those currently living in cities with a low criterion of acquiring a local urban hukou are more sensitive to air conditions. • Subjective attitude and objective health status act as important mediating mechanisms of the air pollution effect.