FERGUSON — The city of Ferguson has agreed to pay nearly $1.7 million to settle a five-year-old lawsuit alleging the north St. Louis County municipality had charged illegal court fees.

A preliminary settlement of the class-action lawsuit was approved by St. Louis County Circuit Judge Joseph Dueker on Tuesday, with a hearing to grant final approval set for May 6.

Lawyers who filed the class-action suit in 2015 argued that three court fees charged by Ferguson — failure to appear, warrant recall and letter fees — had no beneficial value other than to generate revenue for the city.

“The lawsuit is an example of the problems that went on in Ferguson, and I feel that the settlement is good because people are going through a lot nowadays,” Roelif Carter, lead plaintiff in the case, said in a statement.

The lawsuit argued that the requirement to pay a fee to have warrants canceled was illegal, as was the fee to send a letter notifying defendants that they had a warrant. The failure to appear fee, the lawsuit argued, had been implemented illegally by the city.

One of the legal defenses Ferguson used, according to court records, was that residents who paid those fees had already admitted their guilt in court by “voluntarily” paying those fees.