Volkswagen reached a deal Tuesday with the U.S. and the state of California over allegations that it cheated emissions tests on some diesel-powered cars — a deal expected to cost the automaker more than $1 billion. Under the partial settlement with the Justice Department, the Environmental Protection Agency and California, Volkswagen must buy back or fix 83,000 cars from model years 2009 through 2016, including Porsche and Audi models built in Volkswagen plants. Volkswagen still faces criminal charges and lawsuits from individual car owners. "EPA has a public health imperative to hold Volkswagen accountable and remedy the illegal pollution their cars put into the air," EPA official Cynthia Giles said Tuesday. Speaking for California, the head of the state's clean air agency, Richard Corey, said the settlement "highlights the fact that cheating to get a car certified has consequences for air quality and the public health, and that cheaters will be caught and held accountable." California sued Volkswagen, charging that the company violated its Clean Air Act. Volkswagen installed illegal devices on its 3-liter diesel cars. The software detected when the car was having an emissions test and switched on the pollution control devices. It turned them off when the car was being driven. A federal court in October ordered Volkswagen to compensate owners of 2-liter cars that also had the illegal software. Volkswagen admitted cheating on emissions tests in a drive to give customers better performing and more fuel-efficient cars.