Volkswagen will spend more than $15 billion to atone for its diesel cheating scandal in the United States, two thirds of which will go to buying back cars from customers, Bloomberg reports.

Under the settlement, which VW will likely file tomorrow in a San Francisco court, the automaker will pay $2.7 billion in fines to the EPA and California Air Resources Board, and another $2 billion to support zero emission vehicle development, according to Reuters.

This marks the latest and most substantial blow to the deceitful automaker, which rigged more than 10 million diesel vehicles to pass emissions tests between 2009 and 2015. While on the road, the cars spewed up to 40 times the legal limit of nitrogen oxide, a pollutant linked to asthma.

Under this deal, VW will offer to buy back cars from American customers at their pre-scandal value, with a bonus payment of up to $10,000 to smooth things over. It could also fix those cars so they meet emissions regulations for real, but environmental regulators have not approved a plan to allow that.

The US settlement would eat up more than 80 percent of the $18.2 billion VW set aside in April to pay for the global repercussions of its cheating—and these cars sold throughout Europe and Asia. It can expect all sorts of other pain as well. The American DOJ plans to sue VW for violating the Clean Air Act, and the FTC is suing for false advertising. Criminal prosecutions are a real possibility. Oh, and VW's sales are lodged firmly in the crapper, too—down nearly 12 percent in April, and more than 13 percent in May.