Volkswagen will spend about $10.2 billion to settle an emissions cheating scandal in the U.S. that has turned into one of the largest cases of corporate deception in the nation's history.

Two people briefed on settlement talks said most of the money would go to compensate 482,000 owners of cars with 2-liter diesel engines that were 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. VW diesel owners first learned of the deception in September, and most have seen the value of their cars decline. According to the two people, Volkswagen will offer to fix the cars for free, but any fix will likely hurt the cars' acceleration and fuel economy. Alternatively, owners can sell their car back to the company.

Volkswagen, which admitted to intentionally deceiving regulators, will also pay penalties to government agencies such as the Environmental Protection Agency, California Air Resources Board and the Federal Trade Commission, one of the people said.

The settlement is not final yet and terms could change as lawyers work around the clock on final details, said the people, who asked not to be identified because a judge in the case has issued a gag order. Details are scheduled to be released Tuesday by Senior U.S. District Court Judge Charles Breyer in San Francisco.

The $10.2 billion would eclipse the cost of all recent automotive scandals — and the amount VW ultimately pays out could grow by billions of dollars. A lawsuit by the Justice Department is ongoing, and the company could be fined by the state of California. The company also faces as much as $20 billion in fines for violating the Clean Air Act.

General Motors, by comparison, paid roughly $6.9 billion for a series of embarrassing recalls that started two years ago with defective ignition switches that caused at least 124 deaths.

Owners of the VW cars, which date to the 2009 model year, can either sell their vehicles back to the company at the pre-scandal value or let the company fix the vehicle for free, one person said. In either case, owners would also get $1,000 to $7,000 depending on their cars' age, with an average payment of about $5,000, one of the people said.

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, and this May it was $10,674, according to Kelley Blue Book.

Attorneys representing owners, VW and government agencies have not yet agreed on the steps VW will take to repair the cars, the person said. Any fix likely would require a bigger catalytic converter or injection of the chemical urea into the exhaust to help neutralize the pollution. The fixes likely would hurt the cars' performance.

Spokesmen for the EPA, VW and the Justice Department would not comment Thursday.

Around 11 million cars worldwide also had the cheating software, but nitrogen oxide emissions standards aren't as stringent outside the U.S.

Volkswagen owners filed dozens of lawsuits against VW after it acknowledged in September that it intentionally defeated emissions tests and put dirty vehicles on the road.

The $10.2 billion figure also does not include the cost of damage done to VW's brand value and sales. Since the scandal became public, the Volkswagen brand's sales have fallen each month. Through May, sales are down 13 percent compared with a year ago.

The company has admitted developing sophisticated software that determined when the cars were being tested by the EPA on a treadmill-like device called a dynamometer and turned on the pollution controls. Once all wheels began spinning and the steering wheel was turned, the controls were turned off.

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 on real roads.

The settlement to be announced Tuesday does not include 3-liter Volkswagen diesels, which had another version of cheating software.