The state’s highest court ruled Monday that people who pleaded guilty in cases where evidence was mishandled by disgraced state chemist Annie Dookhan cannot be charged with more serious crimes if given a new trial and, if convicted, cannot be given a tougher sentence than originally was imposed.
The unanimous ruling by the Supreme Judicial Court was hailed by the defense bar and civil libertarians as a landmark decision that safeguards the rights of citizens prosecuted with tainted evidence.
“It’s an enormous victory. People can get due process without fearing that the challenge is going to land them back in prison,’’ said Matthew R. Segal, an attorney with the American Civil Liberties Union of Massachusetts, which sought the ruling. “We are definitely in landmark territory.’’
But a spokesman for Suffolk District Attorney Daniel F. Conley, whose office was credited by the SJC for identifying Dookhan-related cases, said the court has cleared the way for people who have already admitted they committed a crime to get an undeserved second chance.
“These convicted defendants now have nothing to lose and everything to gain by withdrawing their evidence-based admissions of guilt,’’ spokesman Jake Wark wrote in an e-mail. “What Annie Dookhan did was an affront to the criminal justice system, but considering that prosecutors have borne the vast majority of the procedural burden in these cases, this seems a lopsided course of action.’’
Wark added that in recent Suffolk County cases where defense attorneys have used the so-called “Dookhan defense’’ — urging jurors not to trust any Hinton lab results — jurors still voted to convict.
“Evidence in a drug case isn’t limited to the drugs: there is almost always additional evidence such as scales, packaging, cutting agents, cellphone records, and the defendant’s actions before, during, and after arrest,’’ Wark wrote.
Suffolk County has the largest number of cases that may have been affected by Dookhan, officials said.
The ruling is the latest effort by the SJC to address the legal issues raised by Dookhan’s deliberate mishandling of drug evidence at the William Hinton lab in Jamaica Plain, which came to light in 2012.
Dookhan pleaded guilty in November 2013 to 27 counts of misleading investigators, filing false reports, and tampering with evidence, and was sentenced to three to five years in state prison, followed by two years of probation that included mental health counseling if needed.
Dookhan played some sort of a role in more than 40,000 drug tests at the Hinton lab, where she worked from 2003 until 2012.
The ACLU and the Committee on Public Counsel Services, the state’s public defender agency, have been battling with district attorneys from Eastern Massachusetts over how to respond to the discovery of flawed testing at the lab.
Under former governor Deval Patrick, Boston defense attorney David Meier conducted a review of the drug lab’s paperwork and identified 31,000 people whose cases had the potential of somehow intersecting with Dookhan and her misdeeds.
But, according to the ACLU and Martin Healy, chief counsel at the Massachusetts Bar Association, no one really knows how many people are linked to Dookhan-related evidence, and no one knows with any precision how many people were imprisoned, evicted from public housing, or lost custody of a child because of the wrongful convictions that resulted.
“We don’t quite have a handle on the exact number still, years later,’’ Healy said.
Written by Justice Francis X. Spina, the unanimous opinion addressed the cases where people chose to plead guilty based on drug evidence that Dookhan may have mishandled.
If the defendants now win a new trial, the court said, prosecutors cannot resurrect the tougher charges that were dropped in return for their pleas.
“In essence, a defendant’s sentence is capped at what it was under the plea agreement,” the court said.
Otherwise, the court said, prosecutors would be “getting a second bite at the proverbial apple” and could potentially end up benefiting from Dookhan’s misconduct.
The court also freed defense lawyers to both appear as witnesses in motions for new trials and to represent defendants seeking to withdraw their guilty pleas.
The defense bar and civil liberties activists said that ruling could save taxpayers millions of dollars.
The court also said that defendants’ testimony at motions for new trials cannot be used against them in later criminal trials.
The court dealt one setback to the public counsel services and ACLU, refusing to issue a single order that would have wiped out tens of thousands of convictions.
Despite prodding from the defenders and civil libertarians to throw out the cases as a matter of justice and as a cost savings for taxpayers, the SJC concluded that “a so-called ‘global remedy’ will not be implemented at this time.’’
Benjamin H. Keehn, an attorney for the public counsel services, said the public defender agency would now return to clients who wanted to challenge their convictions, but backed off because they did not want to take the risk that the new outcome would be harsher than the first.
“This is a huge victory for the victims of misconduct,’’ Keehn said. “It makes clear the burden of fixing those violations of rights needs to stay where it belongs: the Commonwealth.’’
Keehn said it will cost money from the state’s coffers to repair the mistakes made through Dookhan’s misdeeds.