A federal judge in Detroit Friday signed off on what could be one of the last big developments in the Volkswagen diesel emissions scandal, ordering the German maker to pay a $2.8 billion criminal penalty negotiated as part of a settlement with the U.S. Justice Department last January.

The ruling now brings to around $30 billion the costs VW will incur after being caught rigging two of its diesel engines to pass U.S. emissions tests — a figure that includes the price of buying back almost 500,000 vehicles sold in the country. Meanwhile, seven current and former Volkswagen employees have been charged with crimes connected to the scandal, while an investigation continues in Germany.

VW emblems at a Volkswagen production line in Wolfsburg, Germany. Fabian Bimmer / Reuters file

“I just can’t believe that VW is in this situation that it finds itself in today,” said Judge Sean Cox, calling it a “very serious and troubling case involving an iconic automobile company.”

Largest Fine for Automakers

The deal is the largest criminal fine ever negotiated by the U.S. government for a carmaker, dwarfing the penalties levied in recent years against Toyota, General Motors, and Japanese airbag supplier Takata.

For its part, the company took a contrite tone. “Volkswagen deeply regrets the behavior that gave rise to this case,” general counsel Manfred Doess told the court, adding, “Plain and simple, it was wrong,"

In a subsequent statement, the automaker said it has “taken significant steps to strengthen accountability, increase transparency and transform our corporate culture.”

VW will be held to its word. Under terms of the plea agreement, Larry D. Thompson, a former U.S. Deputy Attorney General, will serve as an Independent Compliance Monitor to ensure compliance with the terms of the government settlement during a three-year probation period.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

A Plethora of Penalties

The Friday morning ruling was the latest in a series of settlements federal judges have approved since the scandal first broke in September 2015. At the time, the Environmental Protection Agency accused VW of installing a so-called “defeat device” in products like the Jetta TDI equipped with 2.0-liter diesels. The engine control software was programmed to reduce emissions to legal levels when the vehicle underwent testing. In normal use, however, pollution levels increased as much as 40-fold.

VW soon acknowledged the subterfuge while subsequently admitting it had rigged a more upscale 3.0-liter engine, as well. All told, about 580,000 vehicles sold in the U.S. were impacted, while the global total came to about 11 million.

The scam was apparently launched when Volkswagen engineers failed to come up with an effective technical solution that would allow them to deliver diesel vehicles that were both quick and fuel-efficient while also meeting tough emissions standards.

Related: This Scandal-Ridden Car Company Is Now the World's Best-Selling Automaker

"Who has been hurt by this corporate greed? From what I can see it's not the managers at VW, the ones who get paid huge salaries and large bonuses. As always it's the little guy," added the judge, referring to both Volkswagen customers and its blue-collar workers.

The judge declined to order compensation for alleged victims of the diesel scandal, though VW will pay out billions to those who purchased its rigged models — along with a smaller fund set aside by German supplier Bosch, which participated in the scam.

In July 2016, VW reached a $14.7 billion civil agreement with the EPA and other federal agencies, as well as authorities in California. As part of that deal, it agreed to repurchase the 2.0-liter diesel vehicles it has sold in the States at a cost of more than $10 billion. The package also included money to help offset the extra pollution those vehicles created, along with funds to help promote new zero-emissions vehicle technology, such as battery power.

Later last year, VW also reached a civil settlement covering the 3.0-liter engine. And it negotiated a deal reimbursing its U.S. dealers for their losses. At one point, diesel models accounted for over 20 percent of the brand’s U.S. volume. Volkswagen recently received approval to fix and sell off leftover 2015 diesel vehicles. But Herbert Diess, the global VW brand boss, has said the maker will no longer offer diesel models in the U.S.

Executives Under Indictment

One of the last remaining legal hurdles for Volkswagen in the U.S. is negotiating a settlement covering claims by investors who say their holdings lost significant value when the scam was revealed.

However, criminal charges remain active for six current and former company employees. Another pled guilty in the U.S. District Court last year. Currently, one of the six is being held in a Michigan federal prison. Oliver Schmidt, once based in Michigan, had been in charge of VW’s compliance with U.S. emissions laws. He was denied bail last month and faces a trial next January.

The other five are believed to be in Germany, which does not have an extradition treaty with the U.S. covering this sort of case.

But prosecutors in several German states are continuing their own criminal investigations and have raided offices of both VW and its sibling Audi brand in search of evidence in recent months. Among those considered targets is former Volkswagen AG CEO Martin Winterkorn, who may have assisted in a cover-up once senior management learned of the diesel engine rigging.