WASHINGTON (AP) — Volkswagen and U.S. environmental regulators announced agreement Thursday on a plan for the German automaker to fix most of the diesel cars involved in an emissions cheating scandal.

The company said the Environmental Protection Agency and the California Air Resources Board have approved the program, which involves about 326,000 VW cars sold between 2009 and 2014. That's the first generation of the "Clean Diesel" cars with 2.0 liter TDI engines, including the Jetta, Golf, Beetle and Audi A3.

Under the plan, VW owners can either choose to have their emissions systems repaired for free or have the company buy back their vehicles. The company says the fix does not impair driving performance.

With the deal, Volkswagen said it has completed plans covering about 98 percent of all the affected cars with 2.0 liter engines sold in the United States.

It has been more than a year since VW agreed to pay more than $15 billion to settle criminal charges and civil claims related to the company's sale of nearly 600,000 cars with "defeat devices" designed to beat U.S. emissions tests.

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.

Retrofitting the older "Generation 1" cars to meet U.S. air quality standards represented was an engineering challenge for VW because the cars were not designed to do so in the first place.

The approved fix involves both software and hardware changes that would be installed at dealerships across the United States. Technicians will erase the defeat device software and upload new software that the company says directs the emission controls to function effectively. VW will replace the catalyst that scrubs smog-causing nitrogen oxide from the vehicles' exhaust.

VW is spending more than $20 billion to cover the cost of the global scandal, which includes a total of 11 million vehicles worldwide.

___

Associated Press Auto Writer Tom Krisher in Detroit contributed to this report.

___

Follow AP environmental writer Michael Biesecker at www.Twitter.com/mbieseck