Roughly nine months after details emerged about Volkswagen’s diesel-emissions scandal, the German carmaker has reached settlement terms with U.S. regulators. Last week, the AP reported that the settlement amount would likely add up to around $10.2 billion. Details released by Volkswagen on Tuesday reveal that the settlement exceeds that amount: The company will pay up to $15.3 billion, the largest settlement in automotive history.

That money breaks down into four parts: First, $10 billion has been set aside for compensating owners and buying back their vehicles. According to the filing, the nearly 500,000 owners of the affected cars will receive $5,100 to $10,000 in compensation, regardless of whether they choose to sell their cars to VW (at the pre-scandal market price) or opt to have the company fix them.

Second, Volkswagen will pay $2.7 billion into an EPA fund as penance for the environmental impact of its “clean diesel” cars—the researchers who discovered the “defeat devices” the company installed found some of those cars polluted 40 times the permitted levels of nitrogen oxides. This portion of the settlement will fund projects, unrelated to Volkswagen’s business, aimed at reducing nitrogen oxide pollution.

Third, Volkswagen will invest $2 billion over the next 10 years into EPA programs that promote and develop clean-emissions technology and vehicles. Reuters reports that these programs could fund the development of electric-vehicle charging stations or ride-sharing fleets.

Lastly, the carmaker has settled with the attorneys general of 42 states, along with those of the District of Columbia and Puerto Rico, to pay $603 million to resolve consumer-protection claims alleging that the company defrauded consumers. However, that doesn’t end Volkswagen’s legal troubles: The company is also being sued by its shareholders on the grounds that the scandal has eroded the company’s value. The civil settlements also do not resolve the U.S. Department of Justice’s ongoing criminal investigation into the scandal.

“The settlements do not resolve the government’s pending claims for civil penalties under the Clean Air Act, nor do they resolve pending claims concerning three-liter diesel vehicles,” said Deputy Attorney General Sally Yates at a press conference Tuesday morning. “In addition, the settlements do not address any potential criminal liability, although I can assure you that our criminal investigation remains active and ongoing. We will follow the facts wherever they go and we will determine whether to bring criminal charges against any companies or individual wrongdoers.”

Volkswagen had set aside $18 billion for the fallout of the scandal to cover fines, recalls, and repairs worldwide. But the fix for the affected U.S. vehicles has not yet been agreed upon: Earlier this year, the EPA and the California Air Resources Board (CARB) rejected Volkswagen’s proposed solution. According to the EPA, the emissions modifications mentioned in the settlement must be approved by both CARB and the EPA and comply with U.S. emissions standards. Volkswagen is also required to recall at least 85 percent of the vehicles by 2019 or face further fines.