FILE - This Feb. 14, 2013, file photo, shows the logo on the grill of a Volkswagen on display in Pittsburgh. On Friday, March 10, 2017, Volkswagen is expected to plead guilty to three criminal counts at a morning hearing in Detroit federal court for cheating on diesel emissions tests. (AP Photo/Gene J. Puskar, File)
FILE - This Feb. 14, 2013, file photo, shows the logo on the grill of a Volkswagen on display in Pittsburgh. On Friday, March 10, 2017, Volkswagen is expected to plead guilty to three criminal counts at a morning hearing in Detroit federal court for cheating on diesel emissions tests. (AP Photo/Gene J. Puskar, File) Credit: Gene J. Puskar

Detroit — Volkswagen pleaded guilty on Friday to conspiracy and obstruction of justice and agreed to pay a $4.3 billion penalty for a brazen scheme to program nearly 600,000 vehicles to cheat on U.S. emissions tests.

The criminal and civil penalty, if approved by a federal judge, would be the largest ever levied by the U.S. government against an automaker. VW’s total cost of the scandal now has been pegged at about $21 billion, including a pledge to repair or buy back vehicles.

U.S. regulators confronted VW about the software after West Virginia University researchers discovered differences in testing and real-world emissions of harmful nitrogen oxide. 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 Doess acknowledged to U.S. District Judge Sean Cox.

Summing up the scandal, Assistant U.S. Attorney John Neal said it was a “calculated offense,” not a “momentary lapse of judgment.”

The judge said he wanted more time to study the terms of the punishment negotiated by the U.S. Justice Department, including a $2.8 billion criminal fine. He set a sentencing date of April 21.