Volkswagen has pleaded guilty to conspiracy and obstruction of justice in a scheme to get around US pollution rules on nearly 600,000 diesel vehicles by using software to suppress emissions of nitrogen oxide during tests.
The German automaker has agreed to pay US$4.3 billion ($6.2b) in civil and criminal penalties - the largest ever levied by the US government against an automaker - although VW's total cost of the scandal has been pegged at about US$21bn, including a pledge to repair or buy back vehicles.
US regulators confronted VW about the software after West Virginia University researchers discovered differences in testing and real-world emissions.
Volkswagen at first denied the use of the so-called defeat device but finally admitted it in September 2015.
Even after that admission, company employees were busy deleting computer files and other evidence, VW's general counsel Manfred Doss acknowledged to US District Judge Sean Cox.
Summing up the scandal, Assistant US Attorney John Neal said it was a "calculated offence," not a "momentary lapse of judgment".
Although the cost is staggering and would bankrupt many companies, VW has the money, with $US33bn in cash on hand.
Volkswagen previously reached a US$15bn civil settlement with US environmental authorities and car owners.
Under its agreement, VW must co-operate in the investigation and let an independent monitor oversee compliance for three years. Separately, six Volkswagen employees face criminal US criminal charges in the scandal.