* Court to rule on legality of bans on diesel vehicles
* Retrofits could cost automakers billions of euros
* Similar bans looming in big cities in other countries (Adds delay in ruling to Feb. 27)
LEIPZIG, Germany, Feb 22 (Reuters) - A German court on Thursday delayed a ruling on whether major cities can ban heavily polluting diesel cars, which could hit the resale value of 15 million vehicles in Europe's largest car market and force automakers to pay for costly modifications.
Judge Andreas Korbmacher said the country's highest federal administrative court would rule on Feb. 27 on an appeal brought by German states against bans imposed by local courts in Stuttgart and Duesseldorf over poor air quality.
There has been a global backlash against diesel-engine cars since Volkswagen admitted in 2015 to cheating U.S. exhaust tests, meant to limit emissions of particulate matter and nitrogen oxide (NOx), known to cause respiratory disease.
While other countries are also considering restrictions on diesel cars, bans in the birthplace of the modern automobile would be a new blow for the car industry, and an embarrassment for Chancellor Angela Merkel's government, which has backed it.
"Diesel might get its final kiss of death (from the court ruling)," Evercore ISI analysts wrote in a note to clients.
Germany has long promoted diesel to help cut carbon dioxide emissions and meet climate change goals, but the Volkswagen (VW) scandal has pushed its carmakers to step up spending on electric cars, as well as investments into making diesel engines cleaner.
The federal administrative court in Leipzig is due to rule on whether bans imposed by local courts are legal after environmental group DUH sued city authorities. The DUH is also pursuing bans in many other German cities.
During proceedings in Leipzig on Thursday, lawyers discussed whether the government would have to introduce a new way of labelling cars to enable authorities to enforce any bans.
Judge Korbmacher suggested the European Court of Justice might have to consider the issue of whether bans are permissible.
Merkel's government, which has come under fire for its close ties to the car industry, has lobbied against bans, fearing they could anger millions of drivers and disrupt traffic in cities, with public transport not in a position to take up the slack.
Meanwhile, authorities in Paris, Madrid, Mexico City and Athens have said they plan 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.
A small group of protesters from Greenpeace gathered outside the Leipzig court, with images of lungs painted on their chests and holding up signs reading "Clean Air Now".
"Because the government has failed to do anything for years about exhaust problems in the cities, judges have to decide today how residents will be protected from bad air," said Greenpeace transport spokesman Benjamin Stephan.
The threat of bans has prompted a big fall in sales of diesel cars in Germany, down to just a third of new car sales in January from almost half before the VW scandal.
In an attempt to avert bans, Merkel's government agreed a deal with carmakers last year to overhaul engine management software on 5.3 million diesel cars as well as funding for cities to help cut emissions by taxis and buses.
Environmental groups have called software updates insufficient and have lobbied for cars applying the latest Euro-6 and older Euro-5 emissions standards to have their exhaust treatment systems upgraded.
Evercore ISI has said it could cost up to 14.5 billion euros ($17.8 billion) to retrofit Germany's Euro-5 diesel fleet, and as much as double that if the entire diesel fleet is affected. ($1 = 0.8140 euros) (Reporting by Edward Taylor, Writing by Emma Thomasson; Editing by Keith Weir and Mark Potter)