Germany's top court has paved the way for major cities to ban diesel vehicles.

The Federal Administrative Court in Leipzig ruled Tuesday that cities in Germany have the right to ban some diesel cars. The decision could fuel efforts to implement similar restrictions across Europe.

The court said that Stuttgart and Düsseldorf, which have some of the most polluted air in Europe, have the authority to implement limited bans that would prevent some cars from driving into the city center. But any measures must be proportionate.

Stuttgart is the hometown of Daimler-owned Mercedes-Benz and Volkswagen Group brand Porsche. Düsseldorf and its surrounding area is also a vehicle manufacturing hub.

Dorothee Saar, head of transport and air quality at the environmental lobby group DUH, said that bans could be introduced this year. DUH had been pressing the court to allow diesel bans in order to combat air pollution.

"This ruling gives long-awaited legal clarity that diesel restrictions are legally permissible and will unavoidably start a domino effect across the country," said Ugo Taddei, an environmental lawyer from ClientEarth who worked on the case. "Putting traffic restrictions on the most polluting vehicles is the quickest and most effective way to protect people from harmful air pollution."

The minister of transportation for the Stuttgart region, Winfried Hermann, said local clean air plans would be revised immediately and could include restrictions on highly polluting vehicles. The court said that Stuttgart should also consider restrictions on gasoline-powered cars that do not meet certain emissions standards.

The environment ministry in the Düsseldorf region said it was exploring other strategies to improve air quality and avoid diesel bans.

Volkswagen, BMW (BMWYY) and Daimler have been bracing for new restrictions on diesels amid rising public concern over air pollution and its negative health effects. Anger has been fueled by revelations that Volkswagen had been cheating on diesel emissions tests, allowing its vehicles to emit excessive levels of nitrogen oxide.

Related: Germans are falling out of love with their carmakers

Bans are likely to hurt demand for diesel vehicles in Germany, and deliver a blow to the country's massive auto manufacturing industry. About a third of cars in Germany run on diesel.

Shares in Volkswagen (VLKAF), Daimler (DMLRY) and BMW dropped after the court decision, but later recovered.

Volkswagen said that it was "unable to comprehend" the court's decision.

"It threatens to produce a regulatory hotchpotch in Germany, which is unsettling for millions of motorists," the automaker said in a statement. "How this decision can be implemented in concrete terms is currently still completely unclear."

VDA, the German automotive association, said there were other "intelligent measures" that could be used to meet air quality standards without resorting to bans.

The European Commission -- the top regulator in the European Union -- has threatened legal action against Germany and other countries over high levels of air pollution. Germany is home to 26 cities that frequently exceed EU air pollution limits, more than any other country in the region.

The Commission estimates that over 400,000 people die prematurely each year because of air pollution and nitrogen oxide emissions in the EU.

Diesel cars emit far more harmful air pollutants than gasoline, yet they've been popular in Europe for decades because governments offered tax incentives in the hope of reducing CO2 emissions. (Diesel engines were thought to be more fuel efficient.)

Vehicles are responsible for around 40% of nitrogen oxide emissions in the EU, with the vast majority coming from diesels.

-- CNN's Nadine Schmidt contributed to this report.