Volkswagen will offer "substantial compensation" and car buy-back deals in the US as part of a settlement of the the diesel emissions scandal.
Final details of the packages offered will be announced in June, but a court had given VW and regulators until Thursday to reach a deal in principle.
Last year, US regulators discovered that VW cars were fitted with software that could distort emissions tests.
The German giant subsequently said 11 million cars worldwide were affected.
Details of the preliminary agreement were announced in a California court. US district court Judge Charles Breyer said the settlement would include a buyback offer for nearly 500,000 2.0-litre vehicles.
He did not give details of how much car owners would offered in compensation, but said the deal between Volkswagen, the US government and private lawyers would be "substantial".
Judge Breyer said VW would also pay into an environmental fund and commit other money to promote green car technology.
Volkswagen told its shareholders last year it had set aside $7.3bn to help defray the potential costs of a recall or regulatory penalties, but that figure could rise. The company faces as much as $20bn in fines for Clean Air Act violations alone.
Analyst Marc-Rene Tonn, at Warburg Research, estimated the direct financial impact on Volkswagen from the emissions scandal worldwide $32.3bn.
The US settlement could influence what happens in Europe and in other countries, Mr Tonn said. "Very generous payments to US customers may add to some greediness here, too."
Volkswagen installed software in the diesel engines to detect when they were being tested and cheat the results. Some models could have been pumping out up to 40 times the legal limit of the pollutant, nitrous oxide.