DETROIT/WASHINGTON (Reuters) - A Volkswagen AG VOWG_p.DE engineer pleaded guilty on Friday to helping the German automaker evade U.S. emission standards, and his lawyer said he would cooperate with federal authorities in their criminal probe.

A Volkswagen logo adorns a sign outside a dealership for the German automaker located in the Sydney suburb of Artarmon, Australia, October 3, 2015. REUTERS/David Gray/File Photo

James Liang, who has worked for VW since 1983 and was part of a team of engineers who developed a diesel engine, was charged with conspiring to commit wire fraud and violating U.S. clean air laws. He is the first person to face criminal charges in connection with the diesel emissions cheating case.

The 62-year-old German citizen, who lives in Newbury Park, California, appeared in U.S. District Court in Detroit on Friday and entered into a plea agreement that includes his cooperation with the government in its investigation.

The indictment says Liang conspired with current and former VW employees to mislead the U.S. government about software that federal regulators called a “defeat device,” which allowed the automaker to sell diesel engines that emitted more smog-forming gases than the nation’s emission standards allow.

“I knew that Volkswagen did not disclose the defeat device to U.S. regulators,” Liang said in court. His lawyer, Daniel Nixon, said after the hearing that his client was “very remorseful.”

Liang could face up to five years in prison but may get a much lighter sentence if the government finds he provided substantial assistance.

A grand jury indicted Liang in June, but the indictment was only made public on Friday.

VW spokeswoman Jeannine Ginivan declined to comment on the indictment. “Volkswagen is continuing to cooperate with the U.S. Department of Justice,” she said.

Mark Chutkow, chief of the criminal division for the U.S. Attorney in the Eastern District of Michigan, declined to comment on the investigation.

VW has already agreed to spend up to $16.5 billion to address environmental, state and owner claims in the United States. It still faces billions in potential fines and must resolve the fate of 85,000 polluting 3.0-liter vehicles.

Reuters reported in August that VW and the Justice Department had held preliminary settlement talks about resolving a criminal probe into the emissions scandal.

BUILDING A DEFEAT DEVICE

Liang was one of the engineers in Wolfsburg, Germany, directly involved in developing the defeat device for the Volkswagen Jetta in 2006, according to the indictment.

The engineers had quickly realized the diesel engines they were designing for vehicles targeted at the U.S. market could not meet government clean air standards while appealing to customers, the indictment stated.

So Liang and others, including employees of an entity referred to as “Company A,” designed software that would activate the emission controls of an engine undergoing a government test and deactivate them afterward, according to the indictment.

Liang and others referred to the defeat device as the “acoustic function,” or “cycle-beating” software, prosecutors said.

The indictment said Liang and his co-conspirators designed a software update in 2014 that VW told consumers would fix discrepancies being found in emissions testing. In fact, the update was to allow the cheat system to more easily detect when the vehicle was being tested, using the angle of the steering wheel.

After a West Virginia University study showed the cars were emitting more pollutants on the road than tests had indicated, Liang and his co-conspirators lied to regulators, telling them the discrepancy was caused by “innocent” mechanical issues, authorities said.

The indictment quotes early 2015 email exchanges among Liang and other VW employees showing a rising state of fear that officials of the California Air Resources Board could discover the emissions systems were rigged if they conducted more dynamometer testing on early, Generation 1 diesel cars.

“We must be sure to prevent the authority from testing the Gen 1,” the indictment said an employee wrote in German. “If Gen 1 goes onto the roller at the CARB, then we’ll have nothing more to laugh about!!!!!”