DUH said it hoped the bans in German cities would end the industry's "resistance" to refitting older, more-polluting cars to meet the latest EU standards.

ClientEarth, an environmental law firm that worked on the case, said the win was "a tremendous result for people's health in Germany and may have an impact even further afield".

Lead clean air lawyer Ugo Taddei said: "This ruling gives long-awaited legal clarity that diesel restrictions are legally permissible and will unavoidably start a domino effect across the country, with implications for our other legal cases."

The impact on German drivers could be marked, with millions being forced to leave their cars at home on days when harmful emissions are particularly high.

It could also depress the value of diesel cars affected by the ban.

Of the 15 million diesel cars on Germany's roads, only 2.7 million meet the latest Euro-6 standards, according to data from Germany's automotive watchdog.

Car companies could also incur huge costs to refit vehicles at a time when consumer interest in diesel is falling.

The market share for diesel vehicles in Germany fell from 48% in 2015 to around 39% last year.

Image copyrightMark Renders

Seeking to reassure car owners, the government insisted that nothing would change right away and stressed that bans were not inevitable.

"The court has not issued any driving bans but created clarity about the law," said Environment Minister Barbara Hendricks. "Driving bans can be avoided, and my goal is and will remain that they do not come into force," she added.

"It's really not about the entire country and all car owners," she said.

Bans elsewhere?

Seeking to avert bans, German car makers have pledged software improvements for millions of diesel cars and offered trade-in incentives for older models.

The German government meanwhile has floated alternatives, such as making public transport free in cities suffering from poor air quality.

Paris, Madrid, Mexico City and Athens have all pledged to ban diesel vehicles from city centres by 2025, while the mayor of Copenhagen wants to ban new diesel cars from entering the city as soon as next year.

Carmakers including VW-owned Porsche and Toyota have also signalled they will move away from diesel technology.

Analysts at Evercore ISI said the latest German ruling had "set a strong precedent for similar action across Europe".

"Note, the judge previously commented that the EU has clear rules on emissions and cities have a 'duty' to meet pollution targets."