Attorney General Maura Healey addresses a crowd on May 16, 2022.
CNN  — 

The Commonwealth of Massachusetts has agreed to a settlement that would pay back fees associated with legal cases, probation and fines for tens of thousands of people who were wrongfully convicted of drug charges, according to court documents.

Roughly $14 million is estimated to go to about 31,000 people whose criminal convictions were vacated. The amounts are meant to refund fees incurred, including: victim-witness fees, probation fees, GPS monitoring, restitution, court costs, fines, drug analysis criminal assessment fees, DNA collection fees, parole fees and driver license reinstatement fees, according to a court filing.

The settlement still needs to be approved by a judge.

“Shifting costs to ‘users’ of the criminal legal system creates extraordinary hardships for defendants and their families,” Luke Ryan, one of several attorneys representing people whose convictions were vacated, said in a press release.

“In addition to erecting sometimes insurmountable barriers to re-entry, legal financial obligations require probation and parole officers to allocate substantial time to acting as collection agents that could otherwise be devoted to rehabilitation and public safety,” Ryan said.

The settlement agreement was filed Thursday and comes after a state court vacated the wrongful drug convictions of more than 30,000 people whose cases were associated with two former state lab chemists who worked testing drug samples submitted by law enforcement agencies, but were accused and convicted of tampering with the drug evidence.

Former state chemist Annie Dookhan pleaded guilty in 2013 to 27 counts including perjury, tampering with evidence and obstruction of justice, and was sentenced to three to five years in prison. She was released on parole in April 2016. Former chemist Sonja Farak was convicted of tampering drug evidence in an Amherst, Massachusetts, state crime lab. She was released from prison in 2015.

Massachusetts Attorney General Maura Healey said in a statement to CNN that Dookhan and Farak’s crimes undermined the integrity of the justice system and impacted thousands of lives.

“From the start, we have recognized that defendants with vacated convictions should be refunded and are pleased to have engaged in a collaborative effort to reach a fair and efficient resolution for all involved,” Healey said in the statement.

The settlement could give thousands of people who were impacted back anywhere from $150 to several thousand dollars, Ryan said.

The estimated $14 million in returned fees and fines are not compensating thousands for being wrongfully convicted, said ACLU of Massachusetts Legal Director Matthew Segal.

“This isn’t a case about being compensated for serving time which you shouldn’t have served. This is about returning people their own money that was wrongfully taken from them in connection with their convictions,” Segal said. “So every penny that is part of this settlement is a reminder of all the ways that we punish people as part of the war on drugs.”

Those who receive money as part of the settlement will be allowed to appeal their refund amount, and a settlement administrator will create a website and call center to answer questions and arrange distribution, according to the agreement.