Volkswagen acknowledged that the cars were programmed to cheat on emissions tests. Under the terms of the deal, the automaker agreed to either buy back the cars or fix them and to pay each owner thousands of dollars in additional compensation.

U.S. District Judge Charles Breyer in San Francisco approved that deal in 2016 as part of a $15 billion settlement that also included $2.7 billion for unspecified environmental mitigation and an additional $2 billion to promote zero-emissions vehicles.

The 9th Circuit ruling Monday considered several objections, including returning to Volkswagen any of the $10 billion that is not paid out.

About 90 percent of affected vehicles have already been removed from the road or modified, Elizabeth Cabraser, lead attorney for Volkswagen owners and leaseholders, said in a statement Monday.

“We are pleased with the court’s decision, which acknowledges the widespread support this historic settlement has received from affected Volkswagen owners and lessees and the substantial benefits available to class members,” she said.

Volkswagen has acknowledged that more than 550,000 vehicles in the U.S. were programmed to turn on emissions controls during government lab tests and turn them off while on the road. Investigators found that the cars emitted more than 40 times the legal limit of nitrogen oxide, which can cause respiratory problems.