A US federal district court judge Tuesday gave preliminary approval to a multi-billion-dollar offer from Volkswagen to settle some of its legal woes in the wake of its diesel emissions cheating affair, according to dpa. Judge Charles Breyer called the 14.7-billion-dollar settlement deal fair and reasonable after hearing US authorities, plaintiffs and Volkswagen make their cases in a two-hour hearing in San Francisco. Under the deal, which VW agreed to last month, the German carmaker would spend up to 10 billion dollars buying back or repairing about 475,000 2-litre diesel cars from Volkswagen and Audi equipped with software that manipulated vehicle emissions during official testing. VW has also agreed to compensate owners between 5,100 and 10,000 dollars each. In addition, the carmaker will spend 2.7 billion dollars to support environmental projects, with an additional 2 billion dollars earmarked for research on reducing emissions. The agreement would bring to an end hundreds of civil lawsuits filed against Volkswagen by US consumers, who can now choose to accept the offer or opt out and pursue litigation on their own. The settlement must be approved by Breyer, who has been overseeing the civil suits, before it can come into force. A final hearing has been set for October 18. But some loose ends remain. A plan to repair the cars to meet US emissions standards has yet to be finalized. Another 85,000 cars with 3-litre diesel engines are not covered by the settlement. Questions about how to handle them will be addressed in a court hearing August 25. VW attorney Robert Giuffra said he was confident a solution would be found before then. Meanwhile, the fallout in Germany continued Tuesday with prosecutors adding four more people to the list of those implicated in the software emissions scandal, bringing the total number of defendants up to 21. "Just as before, no board members are included in this group," prosecutor Klaus Ziehe told dpa. VW hopes Breyer's approval of the US deal will help the firm turn a corner in the scandal, which emerged last September when the carmaker admitted to installing so-called "defeat devices" that manipulated emissions test results in 11 million vehicles worldwide. The positive outcome in the San Francisco court added to a series of recent financial successes for Volkswagen. Figures released Monday by the German Center of Automotive Management data collection group showed sales of VW brands, including Audi and Porsche, outpacing rivals Toyota and General Motors during the first half of the year. The group is due to release the details of its half-year results on Thursday.