By Margaret Cronin Fisk and Steven Raphael | Bloomberg News

A veteran Volkswagen engineer was sentenced to 40 months in prison for his role in helping the German carmaker cheat U.S. emissions tests, the first person prosecuted in one of the biggest scandals in the automotive industry’s history.

James Liang, who pleaded guilty to conspiracy last year, got less than the statutory maximum time in prison recommended because he cooperated with the investigation into the automaker, and prosecutors called his “insider’s perspective” key to understanding how VW deceived regulators and consumers for years.

Liang was involved in a scheme to “falsely and fraudulently” deceive regulators and consumers, U.S. District Judge Sean Cox said at a hearing in Detroit Friday.

“This is a serious crime and involved a massive fraud upon the American consumer,” Cox said. Liang, with a large home in Southern California, a swimming pool and a $250,000 yearly income, “didn’t want to walk away from this lifestyle, which would have been the right thing to do.”

“Cooperation or regret doesn’t excuse your conduct,” Cox told Liang.

Liang was the first person to accept responsibility, his lawyer, Daniel Nixon, told Cox. “He became the worldwide face of this scandal.” Liang declined to talk at the hearing.

The German national, who was head of diesel competence in the U.S., was also fined $200,000 and will be supervised after he’s released. A second VW employee, Oliver Schmidt, pleaded guilty Aug. 4 to conspiracy and violating the U.S. Clean Air Act.

Get tech news in your inbox weekday mornings. Sign up for the free Good Morning Silicon Valley newsletter.

Liang and Schmidt are among eight VW executives criminally charged for their alleged roles in the scheme. The charges followed VW’s admission in September 2015 that about 11 million diesel vehicles worldwide were outfitted with so-called defeat devices to cheat emissions. An investigation is ongoing in Germany and against individuals in the U.S.

The scandal has already cost the company more than $24 billion to settle U.S. civil and criminal claims. The bill includes VW’s agreement to pay $4.3 billion in penalties to resolve the federal criminal investigation and plead guilty to using false statements to import cars in the U.S. and obstructing investigations.

VW attempted to boost sales by offering “clean diesel” that would meet heightened emissions standards and attract environmentally conscious customers. The company couldn’t sell vehicles in the U.S. without certifying they met the emissions standards and couldn’t meet the standards with its diesel vehicles without cheating.

“Liang was not the mastermind behind this astonishing fraud,” but “took part in many of the pivotal events,” the U.S. said in court papers Aug. 18. That included developing the deficient engine and defeat device in 2006 and participating in meetings with the U.S. Environmental Protection Agency and the California Air Resources Board in 2007 to get approvals to bring the vehicles into the country.

He was also part of “efforts to hide VW’s use of the device from regulators in 2015,” the U.S. said. “Liang knew that what he was doing was wrong but minimized his own moral responsibility for the fraud by reassuring himself that he was merely an engineer whose job it was to present practical solutions to problems, regardless of their propriety,” prosecutors said in a sentencing memo.

The U.S. recommended a three-year sentence, below the five-year statutory maximum, citing Liang’s “substantial assistance” with prosecutors investigating the fraud.

Liang’s lawyer asked in court papers Aug. 18 for his client to get probation, with one year in a local jail in southern California where Liang lives, or home detention, plus 1,500 hours of community service and a nominal fine. Liang said in the papers he remained in the U.S. after the scandal to work on possible solutions.

Schmidt was indicted along with Heinz-Jakob Neusser, former head of engine development who was suspended in 2015; Richard Dorenkamp, who led the failed effort to design a diesel engine that would meet the tougher emissions standards the U.S. adopted for 2007; Jens Hadler, who led engine development from 2007 to 2011; Bernd Gottweis, who was responsible for quality management from 2007 to 2014; and Jurgen Peter, a VW liaison with U.S. regulators during the months when they were growing more suspicious. Those executives have remained in Germany where they’re safe from extradition to face the U.S. charges. An Audi executive was charged in July with fraud.