BERLIN -- A German court ruled Tuesday that cities can ban diesel cars to lower air pollution, a measure that could affect millions of drivers in the nation that invented the automobile.

The Federal Administrative Court in Leipzig announced its verdict at midday in an appeal brought by two German states against lower court rulings that suggested driving bans for particularly dirty diesel cars would be effective and should be considered.

Environmental campaigners had sued dozens of German cities, arguing that they have a duty to cut excessive air pollution to protect people's health.

Diesel cars emit nitrogen oxides, or NOx, that causes respiratory illnesses and thousands of premature deaths annually.

Get Breaking News Delivered to Your Inbox

Officials have acknowledged that it would be difficult to enforce driving bans only on certain cars.