A Volkswagen engineer pleaded guilty to U.S. federal charges for his role in the diesel emission cheating scandal.

James Robert Liang, 62, who worked at Volkswagen for more than 30 years, faces up to five years in federal prison. They were the first U.S. criminal charges in the Volkswagen (VLKAF) case, where the company sold about 500,000 cars loaded with software that cut back on pollution during emissions testing. The same cars emitted up to 40 times the allowed level of various pollutants when actually driven.

Liang has agreed to cooperate with the investigation of other Volkswagen employees. He might also have to pay a fine of up to $250,000.

"Volkswagen is continuing to cooperate with the U.S. Department of Justice. We cannot comment on this indictment," said VW spokeswoman Jeannine Ginivan.

Liang, a German citizen, helped to develop the so-called "clean diesel" engine for Volkswagen while working in Germany. According to court documents, he and his co-conspirators realized they could not design a diesel engine that would meet the stricter U.S. emissions standards. So they designed and implemented software to cheat the tests.

Related: Volkswagen profits back on track, despite scandal

In 2008, Liang moved to the United States to help win regulatory approval of the diesel engines. He attended meetings with environmental regulators and answered questions about the engines' test results, knowing that that were false, according to the court documents. He faces being deported once he serves his prison term.

Volkswagen has admitted that its cars contained the illegal software. The company still faces a U.S. criminal probe. Volkswagen says its own probe has determined top executives did not know of the cheating scandal, and that it was the work of lower level employees.

But the attorneys general of New York and Massachusetts have filed a suit accusing top executives of engaging in a "massive fraud" to break environmental laws.

Related: Volkswagen emissions scandal in two minutes

The company also has agreed to pay $15.3 billion in civil penalties to compensate owners of its U.S. diesel cars, including an agreement to fix or buy back the cars.