Volkswagen will pay up to $14.7 billion to compensate car owners and settle lawsuits in the United States over its clean diesel scandal, in which the company rigged thousands of cars with software so that they polluted less in testing than they did on the road.

Under the terms of the deal, announced on Tuesday, the automaker will set aside $10.03 billion to compensate affected US car owners. That includes offering to buy back nearly 500,000 diesel vehicles that have so-called "defeat devices" installed, as well as providing affected car owners between $5,100 and $10,000 in compensation.

The company will also pay $4.7 billion in fines to both the US Environmental Protection Agency and the California Air Resources Board. That includes paying $2.7 billion into a fund to reduce nitrogen-oxide (NOx) emissions around the country and investing $2 billion for infrastructure to support zero-emissions vehicles.

Last year, regulators learned that Volkswagen had been installing "defeat device" software in various 2.0 liter diesel vehicles since 2009. That included versions of the Passat, Jetta, Golf, Beetle, and Audi's A3. The software tracked steering and pedal movements and could tell when the car was being tested for NOx emissions inside the labs. The cars were found to emit up to 35 times as much NOx on the road as they did in testing — leading to harmful air pollution above legal limits.

So far, Volkswagen has set aside $17.85 billion to cover the costs of the scandal. This latest settlement only affects the 500,000 cars in the United States — and doesn't apply to the many millions of VW diesel cars in Europe that also had defeat devices.

In addition to dealing with the legal consequences, Volkswagen is also attempting an image makeover. In mid-June, the company announced it was making a huge shift into electric cars, introducing up to 30 plug-in models by 2025.

Further reading: