Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

In the annals of wrongful convictions, there is nothing that comes close in size to the epic drug-lab scandal that is entering its dramatic final act in Massachusetts.

About 23,000 people convicted of low-level drug crimes are expected to have their cases wiped away next month en masse, the result of a five-year court fight over the work of a rogue chemist.

"It’s absolutely stunning. I have never seen anything like it," said Suzanne Bell, a professor at West Virginia University who serves on the National Commission of Forensic Science. "It's unbelievable to me that it could have even happened. And then when you look at the scope of the number of cases that may be dismissed or vacated, there are no words for it."

Annie Dookhan was arrested outside her home in Franklin, Massachusetts, in 2012. Bizuayehu Tesfaye / AP, file

The dismissals will come in the form of filings from seven district attorneys ordered by the Massachusetts Supreme Judicial Court to decide who among 24,000 people with questionable convictions they can realistically try to re-prosecute.

Their answer, due by April 18, is expected to be "in the hundreds," a spokeswoman for Middlesex County District Attorney Marian Ryan said this week. An exact number was not available because the prosecutors are still working through the list, the spokeswoman, Meghan Kelly, said in an email.

The development was first reported by the Boston Globe.

Related: How One Texas County Drove a Record Rise in Exonerations

The prosecutors didn't want the scandal to end like this. They fought for a way to preserve the convictions, and leave it to the defendants to challenge them.

Civil rights groups and defense lawyers argued for all the cases to be dropped, saying that was the only way to ensure justice.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The state's high court chose its own solution, ruling in January that district attorneys should focus on a small subset of cases it wanted to retry, and drop the rest.

A special drug lab session handled motions by drug defendants whose cases were handled by chemist Annie Dookhan. Pat Greenhouse / Boston Globe via Getty Images

It has taken five years to get to this point, longer than it took to discover, prosecute and punish the chemist, Annie Dookhan. She worked at the William A. Hinton State Laboratory Institute in Boston for nearly a decade before her misconduct was exposed in 2012. She admitted to tampering with evidence, forging test results and lying about it. She served three years in prison and was released last year.

By then, most of the people Dookhan helped convict — most of whom pleaded guilty to low-level drug offenses based on her now-discredited work — had finished their sentences.

Is not entirely clear why Dookhan, a Trinidadian immigrant mother, felt compelled to change test results on such a massive scale. She was by far the lab's most prolific analyst, a record that impressed her supervisors but also worried her co-workers — a red flag that went overlooked for years. She seemed driven to stand out, even if it mean lying, former colleagues have said. She also maintained friendly relationships with prosecutors, even though her role was to remain objective.

Related: Rogue East Cleveland Cops Framed Dozens of Drug Suspects

Many of those convicted through Dookhan's work likely did commit the offenses, but many did not, defense lawyers say. All of them are now burdened with dubious convictions that have made it difficult to find jobs and housing or to obtain student loans, the lawyers say. Some defendants were convicted of more serious crimes, and the drug convictions were used to stiffen their sentences. Non-citizens have been threatened with deportation.

Civil rights advocates say the case has exposed the folly of aggressive enforcement of low-rung drug offenders, many of whom are addicts in need of treatment.

"It's a soup-to-nuts indictment of the war on drugs," said Matthew Segal, legal director of the American Civil Liberties Union of Massachusetts, whose lawsuit led to the supreme court's ruling. "These scandals happen around the country because our war on drugs is based on cutting corners."

The William A. Hinton State Laboratory Institute, which houses the Massachusetts state drug lab. Steven Senne / AP, file

The reliance on forensic science in the criminal justice system has improved policing and prosecutions, but the misuse of science has also fueled wrongful convictions, researchers say. Drug labs play a distinct role in that machinery.

Lab scandals have undermined thousands of convictions in eight states in the past decade, according to data maintained by the National Association of Criminal Defense Lawyers. Critics say forensic chemists feel a duty to help prosecutors rather than remain neutral. And they point out that many labs — including Hinton when Dookhan worked there — lack professional accreditation or proper protocols to prevent and detect misconduct. Some of her superiors have lost their jobs for failing to notice or report her misdeeds.

"This drug lab scandal is another example of why the criminal justice system needs to reform its approach to forensic science," said Dan Gelb, a Boston attorney who helped write an amicus brief on the Dookhan case for the National Association of Criminal Defense Lawyers. "Labs shouldn't be an extension of law enforcement."

Former Massachusetts state chemist Annie Dookhan before entering a guilty plea in November 2013. David L. Ryan / Boston Globe via AP, file

Because of the system's reliance on plea bargains to keep cases moving, defendants often don't have a chance to challenge results from drug labs, Bell added.

That's become a big point of discussion at the National Commission of Forensic Science, she said. But the commission, which was formed by the U.S. Department of Justice in 2013, is facing an uncertain future, with no clear message from the Trump administration if its work will continue to be funded, Bell said.

The Dookhan case awakened Massachusetts to the crisis, Bell said.

But the end of the Dookhan saga will not bring the end to Massachusetts' problems.

That's because it is dealing with a second scandal, at a second lab, this one the result of a chemist who admitted to doing drugs — including an array of substances submitted as evidence — while on the job.

Thousands of convictions in that case are now in doubt.