Volkswagen’s long-anticipated $14.7 billion diesel emissions cheating settlement was finalized today in a federal court.

Under the settlement affecting owners of up to 475,000 polluting diesel cars, the German automaker agreed to spend up to $10.033 billion on buybacks and owner compensation. Another $4.7 billion will be spent on programs to support zero emission vehicle infrastructure and other clean vehicle projects. Volkswagen said it will begin buying back the vehicles in mid-November.

VW Settlement May Supercharge non-Tesla DC Rollout in US

Volkswagen may also be allowed to repair vehicles if regulators approve fixes, instead of buying all of them back.

In total, VW has agreed to date to spend up to $16.5 billion to settle the diesel emissions scandal, including payments to dealers, states, and attorneys for owners.

SEE ALSO:  Volkswagen Reaches Preliminary Settlement in Federal Court Over Diesel-Emissions Scandal

The U.S. Environmental Protection Agency discovered in September 2015 that the affected vehicles emit up to 40 times legally allowable pollution levels.

While the decision by U.S. District Judge Charles Breyer in San Francisco today has been anticipated by VW to mark the end of the diesel emissions fiasco, regulatory and lawsuit settlements will continue.

Billions more will be spent on costs to address 85,000 polluting 3.0-liter vehicles and U.S. Justice Department fines for violating clean air laws. The company also faces lawsuits from at least 16 U.S. states for additional claims.