In a Detroit District Court today, 62-year-old engineer James Robert Liang pleaded guilty to conspiracy to defraud the government, commit wire fraud, and violate the Clean Air Act. Liang, currently a California resident, worked for Volkswagen’s diesel development department in Wolfsburg, Germany from 1983 to 2008.

Volkswagen Group has been beset by scandal since last September, when the Environmental Protection Agency (EPA) made public that VW had been including illegal software in diesel Volkswagens and Audis. The software detected when the cars were being tested in a lab so that they could pass emissions tests, but once the cars hit real-world conditions, the software circumvented the emissions control system to spew large amounts of nitrogen oxide (NO x ) into the atmosphere.

According to the plea agreement (PDF), in 2006 Liang and others began building the EA 189 diesel engine that has been the center of the controversy. When the engineers realized they couldn’t meet consumer expectations and US air quality standards at the same time, they began looking into using illegal software (often known in the auto industry as a “defeat device”). By 2008, Liang worked to “calibrate and refine the defeat device.” Later that year, he moved to the US to help with “certification, testing, and warranty issues” for the company’s new diesels.

US prosecutors assert that when Liang and his fellow engineers met with the EPA regulators in 2007 in Michigan to describe the diesel technology that VW’s cars used, they never mentioned any software that enabled the cars’ emissions control systems during lab testing while reducing their efficacy during real-world driving.

The illegal software began showing up in 2009-model VW diesels and was present in VW diesels until the scandal was discovered and made public in 2015. “During this time, Liang and his co-conspirators knew that VW marketed VW diesel vehicles to the US public as ‘clean diesel’ and environmentally-friendly, and [VW] promoted the increased fuel economy,” the plea agreement says.

Nearly 500,000 2.0 L diesels have illegal software on them. 3.0L diesel vehicles made by Volkswagen Group have also been discovered with defeat devices, but those models are not mentioned in Liang's plea agreement.

An interesting wrinkle in the prosecutors’ claims is that early VW diesel owners began experiencing problems with their emissions control systems as their vehicles grew older, causing increased warranty claims for the company. Allegedly, some of Liang’s peers thought this was because the cars weren’t switching over to the more-polluting “road mode” and were getting stuck in “testing mode,” in which the emissions control system was fully effective. “Liang worked with his co-conspirators to enhance the defeat device to allow the vehicle to more easily recognize when the vehicle was no longer in testing mode,” the plea agreement states.

As part of the agreement, Liang will cooperate with the US in further investigations of the VW Group emissions scandal. If he complies, no further evidence can be used against him. He’s set to be sentenced on January 11 and could get up to five years in prison.

Liang has submitted the first guilty plea for an individual in the Volkswagen scandal. Top executives at the company have blamed individual engineers for the defeat devices, but attorneys general in New York, Maryland, and Massachusetts claim that Volkswagen’s top officials knew much about the secret software.

Update, 3:45 p.m. EDT: In an e-mail to Ars Friday afternoon, Liang's Lawyer, Daniel V. Nixon, commented "Mr. Liang came to court in Detroit today to accept responsibility for his actions. He is one of many at Volkswagen who got caught up in the emissions scandal and he is very remorseful for what took place."