An agreement will give owners of hundreds of thousands of Volkswagen vehicles rigged to cheat on emissions tests the option of having the automaker buy back the cars or fix them, a judge said Thursday.

Senior U.S. District Judge Charles Breyer did not give details on how much car owners would be paid but said the deal between Volkswagen, the U.S. government and private lawyers would include "substantial compensation."

He also did not say how more than 480,000 vehicles would be repaired. He said terms of the agreement were still being worked out and ordered all sides to keep them confidential during negotiations.

It will include a fund for corrective efforts over the excess pollution, and Volkswagen will be required to commit other money to promote green automotive technology, said Breyer, who has not formally signed off on the deal yet.

"I am extremely pleased to report that the parties have come up with a concrete plan by today's date, and I would like to publicly thank them," Breyer said.

Volkswagen would spend just over $1 billion to compensate owners but did not detail a vehicle fix in the agreement, a person briefed on the matter who asked not to be identified because the deal had not been made public said Wednesday.

The deal affects the owners of about 482,000 Volkswagens with 2-liter, four-cylinder diesel engines who can choose repairs or buybacks. Those with leased vehicles, including VW Jetta, Golf and Passat models dating to the 2009 model year, will be able to give the cars back.

But no agreement has been reached yet on Volkswagen, Audi and Porsche vehicles with 3-liter, six-cylinder engines — an additional roughly 90,000 vehicles.

Experts say fixing older-model diesels will be complicated and costly and most likely would cut their performance and fuel mileage. Those are two main reasons most customers bought the diesel cars.

The agreement does not settle lawsuits by state and local governments, who also are seeing billions from the company. In addition, a handful of Volkswagen dealers have sued over financial losses from diesel cars sitting on their lots that can't legally be sold until the emissions issues are resolved.

Vehicle owners and the U.S. Department of Justice sued the company after it acknowledged in September that it intentionally defeated emissions tests and put dirty vehicles on the road.

Analyst Marc-Rene Tonn at Warburg Research estimated the direct financial impact on Volkswagen from the emissions scandal worldwide at 28.6 billion euros ($32.3 billion). The company also faces losses from declines in market share and having to lower its prices to keep customers.

Any U.S. settlement could influence what happens in Europe and in other countries, he said. "Very generous payments to U.S. customers may add to some greediness here, too."

Shares in Volkswagen were up 5.6 percent in early trading in Europe on news of a deal with the government.

Volkswagen told its shareholders last year it had set aside $7.3 billion to help defray the potential costs of a recall or regulatory penalties. Most outside observers have said that figure is likely far too low. The company faces as much as $20 billion in fines for Clean Air Act violations alone, before paying to fix the cars or compensate their owners.

The Justice Department and Environmental Protection Agency also are weighing potential criminal charges against the company and senior executives.

The court hearing Thursday was expected to touch on a request to add the Federal Trade Commission to the case. The FTC sued Volkswagen in March alleging deceptive advertising over a seven-year period. The marketing targeted "environmentally conscious" consumers via Super Bowl ads, social media campaigns and print ads.

Details of the agreement must be made public on or before June 21. After that, owners will get the chance to comment, the judge said.