* Court ruled cities could ban heavily polluting cars
* Government accused of cosy ties with manufacturers
* Air quality concerns rise up agenda in Germany (Adds quotes from politicians)
By Madeline Chambers
BERLIN, Feb 28 (Reuters) - Germany's government scrambled on Wednesday to find ways to avoid bans on heavily polluting diesel vehicles in major cities, seeking to reassure drivers and carmakers after a court ruled that local authorities were allowed to bar them.
Tuesday's ruling to allow city bans embarrassed Angela Merkel's government, criticised for having cosy ties with the auto industry which employs some 800,000 people, and raises pressure on manufacturers to make costly modifications to vehicles.
In Germany, where motorists expect to drive powerful cars in cities and on motorways with no speed limits, any restrictions will be unpopular. Yet air quality is also a big concern, with green and consumer groups pushing for action.
Merkel's government is at pains to play down the prospect of widespread bans which, companies say, could cut the resale value of up to 15 million vehicles in Europe's biggest car market.
Bans could also herald the end of the combustion engine, which Germans pride themselves on having invented.
"This is a complicated topic. There are different situations in different cities," said government spokesman Steffen Seibert.
Overall, some 70 cities, including Hamburg and Stuttgart, have been found to have excess levels of nitrogen oxide (NOx).
Seibert said NOx levels had fallen in recent years and many cities would not have to resort to bans. But he acknowledged solutions were needed for cities with significantly higher levels of the gas which can cause respiratory diseases.
He added that a new government under conservative Merkel would consider the option of introducing a nationwide blue badge scheme to indicate how clean a car is. Details of any such schemes have not been agreed.
Until now, the Environment Ministry has favoured this option, arguing it would help local authorities control bans. However, opposition is also strong.
"Blue badges are a more positive way of describing a 'driving ban' and I am very doubtful about that," said Stephan Weil, premier of the state of Lower Saxony, home to Volkswagen , Europe's biggest carmaker.
Since VW in 2015 admitted to cheating U.S. emissions tests, German carmakers, also including Daimler and BMW , have faced a backlash against diesel technology, in which they have invested billions.
While slowly moving towards electric cars and committing to software changes, critics accuse the government of skirting bigger steps such as phasing out diesel. France and Britain will ban new petrol and diesel cars by 2040.
Rome, one of Europe's most traffic-clogged cities, plans to ban diesel cars from its centre by 2024, its mayor said, and a number of other European cities are considering curbs.
Carmakers in Germany are also trying to avoid expensive hardware modifications to exhaust systems.
Weil said refits were not a panacea, especially not for smaller cars with little room for additional equipment.
"I prefer a modernisation of the diesel fleet," he told Die Welt daily. "The solution is modern, low-emission vehicles that do not, or barely, pollute the air ... and an expansion of electric vehicles," he said.
One factor complicating any policymaking on a national basis is a difference in emphasis within the German government, which until now has been a coalition of Merkel's conservatives and the Social Democrats (SPD).
Merkel hopes to renew that coalition but needs the approval of SPD members. Results of a ballot on the deal will be announced on Sunday and a government could be in place in March.
Differences were evident on Wednesday when a spokesman for the transport ministry, run by conservatives, said hardware modifications to diesel cars could be very expensive and must bear some relation to the value of the vehicle.
Meanwhile, Justice and Consumer Affairs Minister Heiko Maas, of the SPD, said carmakers must take responsibility.
"Drivers must not foot the bill for the failures of the auto industry," Maas told the Rheinische Post daily, adding software upgrades were insufficient.
He also said the possibility of class-action lawsuits outlined in the coalition deal would help diesel car owners, a measure demanded by consumer groups after the VW scandal.
Other measures floated include introducing free public transport in some cities. At the weekend, documents seen by Reuters showed the government was considering bans on certain routes on an emergency basis.
Writing by Madeline Chambers Editing by Edmund Blair/Keith Weir