Oslo will ban diesel cars from the road for at least two days this week to combat rising air pollution, angering some motorists after they were urged to buy diesel cars a few years ago.

The ban will go into effect on Tuesday on municipal roads but will not apply on the national motorways that criss-cross the Norwegian capital. Better atmospheric conditions are expected on Thursday. Motorists violating the ban will be fined 1,500 kroner (£174).

This is the first time Oslo has implemented a ban of this type after the city council – made up of the Labour and Greens parties – agreed in principle in February 2016 on the use of such a measure.

While diesel cars emit less CO2 they emit more nitrogen dioxyde.

“In Oslo, we can’t ask children, the elderly, and those suffering from respiratory problems to remain holed up at home because the air is too dangerous to breathe,” a Greens city councillor Lan Marie Nguyen Berg said.

The measure has angered some motorists, who were encouraged in 2006 by Norwegian authorities to opt for diesel vehicles, which at the time were considered a better environmental choice than petrol-fuelled cars.

“Make up your minds. It wasn’t very long ago that diesel was recommended over petrol by Jens (Stoltenberg, Norway’s former prime minister, now Nato’s secretary general). Not sure you really know what is best,” wrote an annoyed Irene Signora Maier Tziotas on the Facebook page of the newspaper Verdens Gang.

Mazyar Keshvari, an MP from the populist right Progress Party, which is a member of the coalition government, urged motorists to seek compensation.

“The biggest swindle of Norwegian motorists has now become a reality,” he told the Norwegian broadcaster TV2. “This was part of the red-green government’s (Stoltenberg’s coalition) ingenious climate measures

“Not only did they recommend motorists to buy diesel cars, they also changed the taxes to make them less expensive. That led a lot of people buying a car that they can’t use now.”

Other Norwegians were more philosophical. “Very good measure. We should introduce a permanent ban on diesel in all big cities. The fines should also be doubled,” Kenneth Tempel wrote on VG’s Facebook page.

According to the Norwegian Institute of Public Health, air pollution causes 185 premature deaths in Oslo each year.