Volkswagen will spend more than $15 billion to settle consumer lawsuits and government allegations that it cheated on emissions tests in what lawyers are calling the largest auto-related class-action settlement in US history. Under the settlement revealed Tuesday by a US District Court in San Francisco, VW will pay just over $10 billion to either buy back or repair about 475,000 vehicles with cheating 2-liter diesel engines. The company also will compensate owners with payments of $5,100 to $10,000, depending on the age of their vehicles. Although the company has been working on a repair for the vehicles for months, it appears that VW may not be able to fix the cars and will have to buy them all back, according to the documents. The German automaker also has to pay governments $2.7 billion for environmental mitigation and spend another $2 billion for research on zero-emissions vehicles. Volkswagen also settled with 44 states, Washington, D.C. and Puerto Rico, which also sued the company, agreeing to pay about $603 million. That brings the total settlements announced Tuesday to $15.3 billion. VW is still facing billions more in fines and penalties as well as possible criminal charges. Volkswagen has admitted that the 2-liter diesels were programmed to turn on emissions controls during government lab tests and turn them off while on the road. Lawyers are still working on settlements for another 80,000 vehicles with 3-liter diesel engines. The company got away with the scheme for seven years. As part of the settlement, VW must offer to buy back most of the affected cars, or terminate their leases. That's because, according to court documents filed Tuesday, there currently is no repair that can bring the cars into compliance with US pollution regulations. If VW does propose a repair, it must be approved by the Environmental Protection Agency and the California Air Resources Board. Owners who choose to have VW buy back their cars would get the clean trade-in value from before the scandal became public on Sept. 18, 2015. The average value of a VW diesel has dropped 19 percent since just before the scandal began. In August of 2015, the average was $13,196; this May it was $10,674, according to Kelley Blue Book. If VW can come up with a repair that meets EPA and California standards, it's likely to hurt the cars' acceleration and fuel economy. Volkswagen marketed the cars as both more fuel efficient and better performing that those with regular gasoline engines. The settlement still requires a judge's approval before it can go into effect. Owners can choose to decline Volkswagen's offer and sue the company on their own. The company has to buy back or repair 85 percent of the vehicles or pay even more money into an environmental trust fund. "This historic agreement holds Volkswagen accountable for its betrayal of consumer trust and requires Volkswagen to repair the environmental damage it caused," said Elizabeth Cabraser, the lead attorney for consumers who sued the company. Unless it can develop a suitable fix, VW may be forced to buy back all the 2-liter vehicles. But it appears from documents filed by the Justice Department and EPA that the technology might not be available to fix them. VW has been working on a fix since around the time the scandal broke. "At the present time, there are no practical engineering solutions that would, without negative impact to vehicle functions and unacceptable delay, bring the 2.0 Liter subject vehicles into compliance with the exhaust emission standards and the on-board diagnostics requirements," the order said. Volkswagen says the $10 billion consumer settlement assumes that it will buy back all of the cars. "We take our commitment to make things right very seriously and believe these agreements are a significant step forward," Volkswagen AG CEO Matthias Mueller said in a statement. Don Marron, a banker from Allentown, Pennsylvania, who owns a 2012 Jetta SportWagen diesel, said he's glad Volkswagen is offering more compensation than earlier reports had suggested. But Marron wants assurance that if Volkswagen fixes his car but he doesn't like the way it performs, the company will still buy it back. And if he keeps his car and saves Volkswagen money, he wants compensation for doing that. "At this moment, I don't know anything more than I did a couple of months ago," he said. The scandal erupted in September when US regulators revealed that the German automaker had fitted many of its cars with software to fool emissions tests and had put dirty vehicles 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. Car owners and the US Department of Justice sued. The company, which knew the EPA's testing routine, got away with the scam for seven years before being caught by the International Council on Clean Transportation, which hired West Virginia University to test a VW in real roads conditions. The EPA has since changed its testing to include on-road tailpipe checks. VW said in April that it has set aside $18.2 billion charge to cover the cost of the global scandal, which includes a total of 11 million vehicles worldwide.