Madrid has ordered half of most private cars off the roads on Thursday to tackle worsening air pollution, a first in Spain.

The restrictions will operate between 6.30am and 9pm. The city council said in a statement: “vehicles with even-number registration plates will be allowed to drive around on even-number days and cars with odd-number registration plates on odd-number days”.

The measure is activated when levels of harmful nitrogen dioxide in the atmosphere go above 200 microgrammes per cubic metre in at least two measuring stations for two days running, and if the air is unlikely to clear imminently.

On Thursday, city environment councillor Ines Sabanes said the ban would not be extended as smog levels had dropped by the required amount. Other measures, including a ban on street parking for non-residents and reduced speed limits, will continue.

There are exceptions to the ban, such as for mopeds, hybrid cars, those carrying three people or more or used by disabled people. Buses, taxis and emergency vehicles are also exempt.

“It’s not about traffic restrictions but about the important issue of public health,” deputy mayor Marta Higueras said. “Lots of people suffer from breathing problems and are very affected by pollution.”

With 3.2 million residents and 1.8m cars, Madrid often suffers from bad bouts of pollution. The move to ban half of cars is level three on a scale of four anti-pollution measures. Level four bans taxis from the city, except those that are hybrid cars.

The measure implemented by the city hall, which has been led by an alliance of leftist groups since 2015, sparked criticism from the conservative Popular party (PP) which ruled Madrid for nearly a quarter of a century and governs at the national level.

Íñigo Henríquez de Luna, a PP spokesman in Madrid’s local parliament, called the move “ideological” and said authorities should do more to encourage residents to avoid using their cars rather than punish them.

The anti-pollution measures were implemented by former PP mayor Ana Botella just before municipal elections in May 2015.