Environmental groups have urged cities to consider such bans as part of efforts to reduce emissions
A German court has found that cities in the country can legally impose a ban on some diesel vehicles to combat air pollution.
The Federal Administrative Court in Leipzig found that local authorities can impose such traffic bans without the need for federal legislation.
BBC reports that the ruling means that the cities of Stuttgart and Düsseldorf - the two cities at the centre of the case - could legally ban older and more polluting diesel cars from zones worst affected by pollution.
Environmental group Deutsche Umwelthilfe had taken legal action against the two cities, in a bid to push authorities to consider diesel bans as part of their efforts to reduce emissions.
Local authorities had gone to the federal court to appeal against decisions by lower regional courts compelling the cities to consider such a ban, TheLocal reports.
According to the Associated Press, a diesel ban could see millions of drivers forced to leave their vehicles at home on days when emissions are particularly high.
The court's decision today comes despite opposition from both the German government and the motor industry.
While the ruling does not oblige Stuttgart and Düsseldorf officials to impose diesel bans, it puts pressure on them and counterparts in other German cities to consider the possibility as they fight to lower emissions.
In a statement welcoming the court decision, the German environmental group Nature and Biodiversity Conservation Union (NABU) said: "The pressure on politicians and manufacturers to finally take effective measures to reduce air pollution for road traffic has again increased significantly.
"Affected cities must become the trailblazers for a change in traffic as soon as possible, in order to strike a balance between mobility needs and environmental and health protection."
Government data from 2015 Stuttgart as the German city worst affected by pollution.
Diesel fuel is considered a particularly significant health hazard in areas with heavy traffic due to the levels of nitrogen oxide it releases into the air.