BOSTON — More than 20,000 drug cases tied to a disgraced former state chemist appear headed for dismissal, lawyers for the American Civil Liberties Union and public defenders said Tuesday as they combed through legal filings from local prosecutors in Massachusetts.

“We’re all overjoyed today at having what is, we think, the largest dismissal of criminal cases as a result of one case in the history of the United States of America,” said Carl Williams, a lawyer with the A.C.L.U. of Massachusetts, which has pressed for the dismissal of tainted cases.

It was the latest development in the yearslong story of Annie Dookhan, a chemist whose co-workers called her Superwoman because she worked so fast. But she was found to have mishandled drug samples, forged signatures and returned positive results on drugs she never bothered to test, and in 2013, she pleaded guilty to 27 counts, including obstruction of justice, perjury and tampering with evidence.

By then, the damage was done. Prosecutors and defenders around the state had already begun the imposing task of figuring out which convictions had been tainted by the failings. Early estimates rose above 40,000. Hundreds of people were released from prison.