BOSTON -- The highest court in Massachusetts has formally approved the dismissal of more than 21,000 drug convictions that were tainted by the misconduct of a former state drug lab chemist.

The American Civil Liberties Union of Massachusetts says the final order from the Supreme Judicial Court on Thursday marks the single largest dismissal of convictions in U.S. history.

“Today is a major victory for justice, fairness, and the tens of thousands of people who were wrongfully convicted based on fabricated evidence,” executive director Carol Rose said in a statement.

The action by the court was expected after seven district attorneys in eastern Massachusetts submitted lists on Tuesday totaling 21,587 cases they would be unwilling or unable to prosecute if new trials were ordered.

Get Breaking News Delivered to Your Inbox

The cases were called into question after chemist Annie Dookhan was charged in 2012 with tampering with evidence and falsifying drug tests. Dookhan pleaded guilty to perjury and other charges in 2013 and served a three-year prison sentence before being released on parole.

Many of the drug case defendants have already completed their sentences, though some probably remain in prison because of other charges not contaminated by the lab scandal. About 2,000 cases had been resolved before Tuesday.

Dookhan worked as a chemist at the Hinton State Laboratory Institute in Boston for nine years, testing more than 60,000 drug samples involving 34,000 defendants. Her arrest prompted the shutdown of the lab and the resignations of three officials. Nearly 200 inmates were released from prison within two months of Dookhan’s arrest.

Prosecutors said Dookhan admitted “dry labbing,” or testing only a fraction of a batch of samples and listing them all as positive for illegal drugs, to “improve her productivity and burnish her reputation.”

At the time of her arrest, authorities said the only motive they discovered was Dookhan’s desire to be seen as a good worker. Co-workers nicknamed her “superwoman” because her caseload was three times higher than average. A state investigation found Dookhan’s co-workers raised red flags about her work at several points prior to her arrest.

During a hearing prior to Dookhan pleading guilty, her lawyer Nicolas Gordon argued that she made a series of tragic mistakes and that her only motivation was to be “the hardest-working and most prolific and most productive chemist.”