CHICAGO (Reuters) - Chicago will pay almost $39 million to settle a class-action lawsuit that accused the city of ignoring its own rules in handling traffic tickets that stemmed from its red-light camera system, city officials said on Wednesday.

The $38.75 million deal, which includes waiving $12 million in outstanding tickets, means some drivers will be reimbursed for portions of tickets they received between 2010 and 2015.

The lawsuit, filed in 2015 and representing more than 1 million people, alleged the city deprived drivers of due process by not issuing a second warning for violations before determining the driver was responsible. It also argued the city prematurely increased fines for late payments.

The red-light camera system has been long derided by residents and earlier this year its former vendor, Redflex, agreed to pay the city $20 million to settle a lawsuit linked to a bribery scheme between the firm’s former chief executive and a city transportation official.

“We’re going to today, with our payment, right years of wrongs,” Chicago Mayor Rahm Emanuel told reporters after the city council meeting at which the settlement was approved.

Emanuel said he accepted responsibility for mistakes made with the camera system during his tenure, but added the troubles began more than a decade ago.

Chicago is home to one of the largest red-light camera enforcement systems in the country, with more than 300 cameras in about 150 intersections across the city, according to a study by Northwestern University researchers released in March. In comparison, New York City had fewer than 200 active cameras in 2015.

Jacie Zolna, an attorney with the firm that brought the lawsuit, said drivers will receive notices by mail explaining how to pursue payment from the settlement. He said the settlement amount is a record for a legal challenge to a traffic camera program.

Chicago will use $10 million of the Redflex payment as part of the city’s settlement, with the rest paid using available operating funds and bond proceeds, city spokeswoman Molly Poppe said.

Chicago intends to stop selling bonds to cover these kinds of expenses starting in 2019, she added.