Most people buying a diesel car in the 2010s did so because they thought it would work out better financially. And it looks like they were right. Forget the extra miles they were able to eke from a gallon of fuel – now a court in Germany has ruled that automakers must compensate owners for diesel cars fitted with emissions cheat devices.

And the levels of compensation the court has in mind is potentially massive, ranging from 5 right up to 15 percent of the purchase price of the vehicle. The case was brought against Volkswagen, Audi and Mercedes, but the verdict will likely have consequences for other brands caught up in the diesel scandal that came to light in 2015.

If carmakers are forced to compensate owners the bill would run into millions of euros, but a VW spokesperson told Reuters that it expected courts to reject compensation claims from car owners because the emissions ‘cheat’ devices weren’t technically illegal. Carmakers claim the devices that could change an engine’s emissions levels were in place and operated to safeguard a motor’s reliability, and were allowed under law.

Related: VW And Audi Agree To $85 Million Dieselgate Settlement In Texas

 European Automakers Owe Drivers Millions For Deceitful Diesels, Court Rules

But the judge in this case, heard at Germany’s highest federal court, told the automakers it was their responsibility to prove that their defeat devices were legal and did in fact serve a purpose that wasn’t to obscure a car’s real emissions levels.

Reuters reports that the legal decision represented a shift in attitude by the court. A previous belief that automakers would only be liable for compensation if they had intentionally installed an illegal cheat device appears to have been changed by a European Court of Justice ruling in March that Mercedes should compensate owners if they suffered damages as a result of their car being fitted with a defeat device.