It looks like owners of diesel-powered Volkswagens who have been hoping to be compensated for cars that pollute more than they were led to believe are getting their wish. The federal judge in San Francisco who is overseeing the multi-district litigation announced today that Volkswagen had reached a tentative agreement to buy back cars and that there would be “substantial compensation” for owners of diesel cars that are part of the emissions scandal. U.S. District Judge Charles Breyer said that the proposal also allowed for Volkswagen to repair the affected cars, if the owners wanted to keep them.

The agreement applies to 482,000 2.0-liter four-cylinder TDI cars that are part of this case. Approximately 80,000 2009-2016 Volkswagen Touareg models with a certain 3.0-liter V-6 engine are still in discussion. Volkswagen owners of affected cars have already received a “goodwill package” from the automaker with a $500 prepaid Visa card, a $500 dealership card and three years of 24-hour roadside assistance.

Volkswagen had until today to reach an agreement with the Environmental Protection Agency and the California Air Resources Board or face going to trial. A hearing for preliminary approval of Volkswagen’s detailed plan is scheduled for June 26.

To learn more about the diesel scandal, read VW exec talks recall in front of Congress.

Tara Baukus Mello writes the cars blog as well as the weekly Driving for Dollars column, providing both practical financial advice for consumers as well as insight into the latest developments in the automotive world. Follow her on Facebook here or on Twitter @SheDrives.