Volkswagen has reached an agreement with the US authorities to settle the emissions scandal, and will offer US consumers either a monetary compensation or an opportunity to fix faulty cars, local media reported on Thursday.

The company will buy back or fix about 500,000 diesel cars, the Wall Street Journal reported.

The Volkswagen emission scandal became public when the US Environmental Protection Agency accused the German automaker of using software to falsify emission test results for its diesel-engine cars.

In September 2015, Volkswagen admitted that it had installed software in their vehicles to falsify emission tests. The company later clarified that an estimated 11 million diesel-engine cars worldwide were emitting up to 20 times more greenhouse gas than showed in the tests.

In early November 2015, the company offered $1,000 in gift cards and vouchers as well as three years of free roadside assistance as a goodwill effort after angering owners of some 482,000 cars who paid extra for the vehicles to be environmentally conscious without loosing power.

Volkswagen’s management knew about emission test rigging as early as August 2015, a month prior to the start of the public scandal, according to the Bild newspaper reported.