The lockdown in 2020 implemented due to the SARS-CoV-2 pandemic has resulted in a significant improvement in air quality at a global scale. Nationwide lockdown also considerably improved air quality at a local scale, especially in cities which were almost completely shut down during the first coronavirus wave, with nearly no activity. We tested the hypothesis that a reduction in the intensity of vehicle traffic causes a drastic decrease in urban air pollution at a local scale. We focused on two urban agglomerations, Warsaw and Cracow, in Poland. Data of the concentrations of traffic-related sources, namely NOx, PM10, and PM2.5, obtained from two air pollution monitoring stations were analyzed for the years 2020 and 2021, during which lockdown and pandemic restrictions were in effect, and for 2019, as a reference. In the years 2020–2021, the average annual concentration of NOx was decreased by ~ 19%, PM2.5 by ~ 19%, and PM10 by ~ 18% in Warsaw, while in Cracow the average annual concentration of NOx was decreased by ~ 16%, PM2.5 by ~ 22%, and PM10 by ~ 2%, compared to 2019. The contribution from traffic-related sources to the overall level of air pollution was estimated. The results indicated that ~ 30 µg/m3 of PM10, ~ 15 µg/m3 of PM2.5, and ~ 120 µg/m3 of NOx in Cracow, and ~ 20 µg/m3 of PM2.5 in Warsaw originate from moving vehicles. The nationwide lockdown allowed us to conduct this study to understand how a reduction in local traffic emissions can decrease ambient air pollution levels.