Abstract. The strictest ever clean air action (CAA) plan has been implemented by the Chinese government since 2013 to alleviate the severe haze pollution. The PM2.5 mass concentration was found to largely be reduced in response to emission mitigation policies, but the response of particle number concentrations (PNCs) to CAA was less evaluated in the previous studies, which may be significantly different from PM2.5 mass due to newly formed particle impacts. In this work, the first in situ observation of particle number size distributions (PNSDs) during 2012–2019 in urban Lanzhou was used to analyze long-term PNC variations and CAA impacts. The average number of particles in nucleation (N13−25, particle number in the size range of 13–25 nm), Aitken (N25−100, particle number in the size range of 25–100 nm) and accumulation (N100−800, particle number in the size range of 100–800 nm) modes were respectively 2514.0, 10 768.7 and 3258.4 cm−3, and N25−100 accounted for about 65.1 % of total PNCs during the campaign. The k-means clustering technique was used to classify the hourly mean PNSDs into six clusters, and each cluster corresponded to a specific source and influencing factor. The polluted clusters governed the winter PNCs before 2016, and their occurrence was less and less frequent after 2016, which was largely dominated by reduction in primary emissions. However, the contribution of new particle formation (NPF) events to summer N13−25 decreased from 50 % to about 10 % during 2013 to 2015 and then increased to reach around 60 % in 2019. The trends of size-resolved PNCs for each cluster were quantified by Theil–Sen regression. The size-segregated PNCs exhibited downward trends for all clusters during 2012–2015, especially in spring. The annual relative slopes of spring PNCs varied from −54.7 % to −17.2 %, −42.6 % to −14.1 %, and −40.7 % to −17.5 % per year for 13–25, 25–100, and 100–800 nm size ranges, and the reduction in the polluted clusters was much larger than NPF clusters. The ultrafine particle number was increased, and the amplitude was much greater during 2016–2019. The annual relative slopes of N13−25 varied between 8.0 % in fall and 135.5 % in spring for the NPF cluster. In response to CAA, the increased daytime net radiation, higher ambient temperature and lower relative humidity at noon for NPF events also could partly explain the higher N13−25 induced by the more frequent nucleation events after 2016, especially in spring. The air masses were mainly from the adjacent regions of urban Lanzhou and less affected by long-range transport for NPF events, and thus the particles were not easily grown by coagulation during transport processes, which was helpful for the occurrence of NPF events. Therefore, some effective measures to cooperatively control particle number concentration and mass should be taken for the Chinese megacities.