German carmakers, fighting for a future for diesel technology in Europe, faced a setback after a Stuttgart court ruled in favor of a complaint seeking to ban all diesel cars from entering the home city of Mercedes-Benz and Porsche.

Diesel driving bans would be an adequate solution to cleaning up Stuttgart's air, while simply upgrading diesels is ineffective, said Judge Wolfgang Kern of Stuttgart's administrative court, ruling on a case brought by an environmental group over the city's failure to comply with emissions levels for smog-inducing nitrogen oxide. Kern's decision, which can be appealed, is likely influence a number of other judicial decisions coming in Germany on the matter.

Automakers, the federal government and some German states are seeking to avoid such bans by instead pursuing recalls to improve emissions as the diesel-cheating scandal that erupted two years ago at Volkswagen AG continues to engulf the industry. On Thursday, German Transport Minister Alexander Dobrindt took a hard-line stance against Porsche, accusing the sports-car maker of using a defeat device in the Cayenne and forcing the VW unit to recall thousands of the sport utility vehicle.