Carmakers must pay compensation for diesel vehicles fitted with illegal emissions controlling devices, Germany’s highest federal court has ruled, in a case which could potentially cost Volkswagen, Mercedes-Benz and others millions of euros.

Companies could owe owners between 5% and 15% of the purchase price of their vehicle, the court ruled, in a case against Volkswagen, its Audi brand and Mercedes-Benz that has implications for similar lawsuits, Reuters reported.

The judge overturned previous dismissals by courts of such claims and referred them back to courts of appeal. It was up to carmakers to prove their so-called defeat devices were functional and not illegal, she said.

The news agency noted defeat devices are mechanisms or software that can change vehicle emissions levels, leading to numerous court disputes over whether manufacturers use them improperly to mask the true pollution levels of their vehicles. Carmakers argue the devices, which are only switched on at certain temperatures, are needed to protect the motor and are in line with the law.

Asked about the ruling, Volkswagen said its defeat devices were not illegal and as such it was convinced courts would continue to reject any compensation claims.

Mercedes-Benz argued European authorities considered such temperature windows to be permissible until July last year and as such using them could not be seen as negligence.

But, Reuters said, European courts are increasingly backing car owners and environmental groups calling for recalls and compensation on vehicles with such devices, a high cost hangover from the industry’s 2015 diesel scandal – which centred on Volkswagen – at a time when it is under pressure to focus on the transition to electric vehicles.

The news agency said the decision was a change from the court’s previous position that carmakers could only be charged if they had intentionally installed an illegal device, after the European Court of Justice decided owners were owed compensation even in cases where the damage to plaintiffs was caused by negligence.

Dieselgate Audi ex-CEO sentenced