To prevent the escalation of COVID-19 transmission, China locked down one-third of its cities, which strictly curtailed personal mobility and economic activities. Using comprehensive daily air quality data in China, we evaluated the impacts of these measures in terms of the Air Quality Index (AQI) and the concentrations of particulate matter with a diameter of less than 2.5 μm (PM2.5). To infer their causal relationships, we employed difference-in-differences models that compare cities with and without lockdown policies. We found that city lockdowns led to a sizeable improvement in air quality. Within weeks, the AQI in the locked-down cities was brought down by 19.84 points (PM2.5 down by 14.07 µg m−3) relative to the control group. In addition, air quality in cities without formal lockdowns also improved because of the enforcement of other types of counter-virus measures. The AQI in those cities was brought down by 6.34 points (PM2.5 down by 7.05 µg m−3) relative to the previous year. The lockdown effects are larger in colder, richer and more industrialized cities. Despite these improvements, PM2.5 concentrations during the lockdown periods remained four times higher than the World Health Organization recommendations, suggesting much further effort is needed. Existing environmental policies could obtain similar air quality improvements at a much lower economic cost, making city lockdowns an unsustainable option to address environmental issues.