DETROIT – A Volkswagen engineer who had a key role in the company’s diesel emissions scandal was sentenced Friday to more than three years in prison and a $200,000 fine, a steeper punishment than prosecutors requested.

James Robert Liang, 63, knew the German automaker was cheating and worked to cover it up, U.S. District Court Judge Sean Cox said during the sentencing hearing in Detroit. The judge imposed a 40-month prison sentence.

“The conspiracy perpetrated a massive … and stunning fraud on the American consumer that attacked and destroyed the very foundation of our economic system,” Cox said.

Liang, who faces deportation to Germany upon his release from prison, declined to speak on his own behalf Friday. Prosecutors had requested a 36-month prison term and a $20,000 fine.

Prosecutors said Liang was aware that VW used software to cheat U.S. emission rules on nearly 600,000 diesel vehicles. His lawyer said he’s not “greedy or immoral” but followed orders to keep his job and support his family.

“What occurred here was wrong,” defense attorney Daniel Nixon said. “But he wasn’t the mastermind. He was not motivated by greed.”

Liang pleaded guilty last year to one count of conspiracy to defraud the government and agreed to cooperate with investigators. Liang had asked the judge to consider a sentence of probation and 1,500 hours of community service.

He is one of two VW employees to plead guilty, although others charged in the case are in Germany and out of reach.

Volkswagen and U.S. environmental regulators announced agreement last month on a plan for the automaker to fix most of the diesel cars involved in the emissions cheating scandal.

Volkswagen has admitted that the cars were sold with illegal software programmed to turn on emissions controls during government lab tests and turn them off while on the road. Investigators determined that the cars emitted more than 40 times the legal limit of nitrogen oxide, which can cause respiratory problems in humans.

The company got away with the scheme for seven years until independent researchers reported it to government regulators.