This study aims to balance the dual objectives of improving environmental quality and achieving carbon peaking and carbon neutrality goals. Utilizing panel data from 274 Chinese cities between 2006 and 2020, this paper employs the difference-in-differences method to examine the impact of the Air Pollution Prevention and Control Action Plan (APPCAP) on urban carbon emissions. Empirical results indicate that the impact of the APPCAP on regional carbon emissions follows an inverted U-shaped curve, exhibiting a dual impact path. Although the implementation of the APPCAP increased the annual carbon emissions of the city by an average of 1.637 million tons, it showed a trend of inhibiting the growth of carbon emissions, although it was not significant. Specifically, the APPCAP is most effective in reducing carbon emissions during the "source prevention" stage, primarily by increasing industrial electricity consumption and reducing coal production and consumption. However, a rebound effect occurs at the policy period's end, with compensatory increases in crude oil and electricity consumption, thereby elevating regional carbon emission levels. The APPCAP's effect on carbon emissions is more pronounced in areas with lower population density and higher environmental regulation intensity. It notably raises carbon emission levels in non-industrial base and non-resource-based cities compared to other cities. Furthermore, the APPCAP positively impacts regional carbon emission intensity and economic growth, significantly driving the secondary industry while minimally affecting the primary industry.