Volkswagen's deliberate cheating on emissions tests will cost it a record $14.7 billion. And that's just the start of its problems.

The settlement is only a preliminary step in the case; the automaker still faces possible criminal charges, as well as civil penalties for Clean Air Act violations. The Department of Justice is investigating possible criminal charges against both the company and individuals, said Deputy Attorney General Sally Yates.

Volkswagen's wrongdoing constituted "the most flagrant violations of our consumer and environmental laws in our country's history," said Yates. "We cannot undo the damage that's been done to our air quality, but we can offset that damage."

Related: Prosecutors probe Volkswagen former CEO over diesel scandals

Up to $10 billion of the funds will be paid out to owners of the 487,000 affected diesel cars in the U.S., sold under the VW or luxury Audi brands. How much an owner gets will depend on whether an owner chooses to fix their car or just have VW buy it back -- they have until May 2018 to decide.

Repurchasing the cars will cost VW between $12,500 to $44,000 per car. The $14.7 billion settlement estimate assumes that all the cars are repurchased.

Owners who elect to get their vehicles fixed will also get a cash payment of between $5,100 and $10,000 to compensate them for the lost value of the cars, as well as for Volkswagen's deceptive promise of "clean diesel." Most of the buyers paid extra for a car with a diesel engine.

To date there is no EPA-approved fix to bring the cars into compliance with environmental regulations, although EPA Administrator Gina McCarthy said she hoped there would be a solution within six months.

In addition to the customer payments, Volkswagen (VLKAF) will pay $2.7 billion for environmental cleanup and $2 billion to promote zero-emission vehicles. The clean up money will be used by individual states to cut other diesel emissions by replacing older, government-owned trucks, buses and other diesel engines now in use.

The cars had software installed that strictly limited emissions when the cars were being tested, then dumped up to 40 times the allowable levels of some pollutants when on the road. VW admitted to the wrongdoing in September.

"We take our commitment to make things right very seriously and believe these agreements are a significant step forward," said VW CEO Matthias Müller. "We know that we still have a great deal of work to do to earn back the trust of the American people."

The settlement amount dwarfs other payouts by other automakers.

Related: New bombshell lawsuit against Volkswagen

General Motor (GM)paid a criminal fine of $900 million for a faulty ignition switch tied to at least 124 deaths, and an additional $600 million to victims and their families. It also faces a class action lawsuit seeking damages on behalf of car owners.

Toyot (TM)agreed in 2012 to pay a $1.2 billion fine, and settled with car owners for an additional $1.1 billion to settle claims related to unintended acceleration of its cars tied to at least 93 deaths, according to a 2010 estimate from NHTSA, the federal safety regulator.

"Volkswagen's proposed settlement is unprecedented in its dollar amount, but the situation was unprecedented, in that it was not a mistake but a deliberate deception," said AutoTrader analyst Michelle Krebs.

The largest payout for a single instance of corporate wrongdoing is the $20.8 billion that BP (BP) agreed to pay last year to settle various charges related to the 2010 Deepwater Horizon disaster in the Gulf of Mexico. Out of that payment, $5.5 billion is allocated for federal Clean Water Act penalties, $8.1 billion for natural resource damage and $4.9 billion to compensate various Gulf states affected by the oil spill. BP has estimated its total cost for the disaster, including compensation to businesses and individuals, at $54.6 billion.

Several major Wall Street banks have paid more than $20.8 billion in fines and penalties related to the financial crisis. But that total reflected multiple settlements for different instances of wrongdoing.