A U.S. federal judge on Tuesday approved one of the largest consumer settlements in U.S. history, a $14.7 billion settlement that could remove nearly half a million diesel-powered cars off U.S. roads.

U.S. District Court Judge Charles Breyer in San Francisco (who declined to rule on the settlement last Tuesday so as to accommodate objections from members to the class action lawsuit who wanted bigger payouts) approved the sweeping agreement between VW and Audi owners, the government, California regulators and Volkswagen.

The settlement covers certain Volkswagen and Audi “clean diesel” vehicles with 2.0-liter TDI engines. The parties are still negotiating claims related to 3.0-liter engines.

“Given the risks of prolonged litigation, the immediate settlement of this matter is far preferable,” Breyer said in a 48-page order. “As the court stated at the outset, the priority was to get the polluting cars off the road as soon as possible. The settlement does that.”

Breyer made no modifications and found the settlement meets the standards for approval.

Volkswagen admitted in September 2015 that it had installed software in its TDI clean diesel cars which allowed it to cheat emissions tests, tricking regulators into allowing the cars on the road.

Volkswagen drivers sued the company for fraud, breach of contract, unjust enrichment and racketeering, and violations of consumer protection laws in every state.

The company is still facing criminal investigations by the U.S. Justice Department and German prosecutors. The U.S. probe could lead to additional financial penalties and criminal indictments.