WASHINGTON — The Justice Department sued Volkswagen on Monday over emissions-cheating software found in nearly 600,000 vehicles sold in the United States, potentially exposing the company to billions of dollars in penalties for clean air violations.

The civil complaint against the German automaker, filed on behalf of the Environmental Protection Agency in U.S. District Court in Detroit, alleges the company illegally installed software designed to make its "clean diesel" engines pass federal emissions standards while undergoing laboratory testing. The vehicles then switched off those measures in real-world driving conditions, spewing harmful gases at up to 40 times what is allowed under federal environmental standards.

"Car manufacturers that fail to properly certify their cars and that defeat emission control systems breach the public trust, endanger public health and disadvantage competitors," John C. Cruden, the assistant attorney general for the Justice Department's Environment and Natural Resources Division, said in a statement.

"The United States will pursue all appropriate remedies against Volkswagen to redress the violations of our nation's clean air laws alleged in the complaint," he said.

The company is in the midst of negotiating a massive mandatory recall with U.S. regulators and potentially faces more than $18 billion in fines for violations of the federal Clean Air Act.

FILE - In this Sept. 23, 2015 file photo the silhouette of visitor pictured next to the logo of German car manufacturer Volkswagen AG at the International Motor Show IAA in Frankfurt, Germany. Volkswagen said Wednesday, Dec. 9, 2015, that a problem with carbon dioxide emissions is far smaller than initially suspected, with further checks finding "slight discrepancies" in only a few models and no evidence of illegal changes to fuel consumption and emissions figures. (Boris Roessler/dpa via AP, File)

The company and its executives could also still face separate criminal charges, while a raft of private class-action lawsuits filed by angry VW owners are pending.

Volkswagen Group of America spokeswoman Jeannine Ginivan said Monday that the company "will continue to cooperate with all government agencies investigating these matters."

In past statements, high-ranking VW executives have sought to blame only a small number of software developers in Germany for the suspect computer code designed to trick emissions tests. The company has hired a U.S.-based law firm to conduct an internal investigation into the scheme. The findings of that review have not yet been made public.

The company first acknowledged in September that the cheating software was included in its diesel cars and SUVs sold since the 2009 model year, as well as some recent diesel models sold by the VW-owned Audi and Porsche brands. Worldwide, the company says cheating software was included in more than 11 million vehicles.

The federal lawsuit alleges that Volkswagen intentionally tampered with the vehicles sold in the U.S. to include what regulators call a "defeat device," a mechanism specifically designed to game emissions tests. Under the law, automakers are required to disclose any such devices to regulators.

Because Volkswagen kept its suspect software secret, the lawsuit alleges the company's cars were sold without a valid "certificate of conformity" issued by EPA to regulate new cars manufactured or imported into the country.

In addition to producing far more pollution than allowed, experts say the excess nitrogen oxide and particulate emissions from the more than half-million VW vehicles had a human cost. A statistical and computer analysis by the Associated Press estimated the extra pollution caused somewhere between 16 and 94 deaths over the last seven years, with the annual toll increasing as more of the diesels were on the road.

"With today's filing, we take an important step to protect public health by seeking to hold Volkswagen accountable for any unlawful air pollution, setting us on a path to resolution," said Assistant Administrator Cynthia Giles for EPA's Office of Enforcement and Compliance Assurance. "So far, recall discussions with the company have not produced an acceptable way forward. These discussions will continue in parallel with the federal court action."

Justice Department officials said on Monday the case was filed in the Eastern District of Michigan because that is where "significant activity" related to the company's cheating scheme occurred. EPA's primary emissions-testing lab is located in Ann Arbor and Volkswagen also has facilities in the Detroit metro area.

However, as the legal case proceeds, the venue is expected to move to Northern California, where hundreds of the class-action cases have been consolidated and state regulators played a key role in uncovering VW's deceptions.

This is a developing story. Stay with the Times Free Press for updates.