Rating agency Moody's warned that such a move could undermine the principal method used to sell billions of euros worth of cars.

The company argued that a court ruling last week to pursue bans on diesel cars in the city of Stuttgart could trigger a fall in the second-hand vehicle market used to underpin a system of cheap credit finance.

Car sales have received a boost in the past decade thanks to finance contracts such as PCPs that enable customers to make only small monthly payments for cars costing tens of thousands of euros.

At the same time, carmakers shifted the risk of default on these loans to debt investors using asset backed securities (ABS) via securitization.

In addition to monthly instalments, most of these car loans include a final "balloon" payment worth up to 60% of the vehicle's purchase price.

Car buyers have not been forced to find cash to cover the balloon instalment when a loan matures because they could instead trade in their car to cover the cost.

This system has relied on the value of the vehicle being equivalent to the outstanding amount in payments due.

But Moody’s believes that the German court ruling last week raised the prospect of diesel bans, a step which could lead customers to shun diesel-powered vehicles and lead second-hand car values to deteriorate.

Environmentalists have vowed to press ahead with legal action aimed at banning polluting vehicles despite a clean-up plan agreed by German politicians and car bosses.

"If residual values decline, dealers will have difficulty covering residual value losses," Moody's predicted.

"Consequently, they might not have the financial capacity to fulfil their repurchase obligations and borrowers would be more likely to default on the unexpected obligation to cover the balloon payment themselves."

The warning from Moody's echoes comments from the Bank of England and Britain's financial watchdog about PCP agreements made to fund the buying of cars.

Downward pressure

The residual value of a car is also used as a basis for calculating monthly leasing payment rates. A lower residual value would force carmakers to push up monthly instalments, potentially slowing sales and increasing defaults.

"Concrete measures to ban diesel cars in urban areas would significantly cut the cars' attractiveness, leading to declining residual values that would adversely affect the credit quality of German auto ABS," Moody's added.

German auto ABS have shown average cumulative losses of 0.1% over the life of the currently outstanding transactions.

With 15.6 million new car registrations in the past five years in Germany, and 4.1 million auto finance contracts currently securitized, a significant part of the

German fleet is affected, the credit rating agency stressed.

This week German car sales data showed demand for diesel cars fell 12.7% in July. Now diesel makes up only 40.5% of new car sales in Europe's largest car market, down from 46% at the end last year.

Registration figures for 2016 show that Renault sold 45% of its new cars with diesel engines, while Daimler's global share of diesel cars was 38%.

BMW's overall share of diesel cars was 35% and Volkswagen's was 26%.