On Jan. 9, 2012, Sonja Farak—a chemist at a crime lab in Amherst, Massachusetts—pilfered a sample of crack cocaine and smoked it in the bathroom throughout the morning. Then, before lunch, she stole and ingested some LSD. Farak later admitted that she was “too impaired to drive home” or use the laboratory equipment.

That same day, Farak certified that a substance delivered to the lab was heroin. The substance had been found on Rolando Penate, whom prosecutors charged with selling heroin, citing Farak’s certification. Penate served five years, seven months, and 12 days in prison.

It wasn’t an isolated case. Farak began using drugs from the lab in 2005 and continued to do so until she was arrested in 2013. All told, roughly 18,000 convictions were tainted by certifications that Farak issued while under the influence. Now the ACLU is asking Massachusetts’ Supreme Judicial Court to vacate these convictions. All of them. With prejudice. It’s an extraordinary, sweeping remedy. The court should grant it.

Farak isn’t the only crime lab chemist in Massachusetts who engaged in criminal behavior at work: Over her nine-year career, Annie Dookhan falsified tens of thousands of reports, frequently certifying results without testing the substance. Dookhan’s misconduct tainted about 24,000 convictions—but the SJC refused to dismiss all of them at once, explaining that such “strong medicine … should be prescribed only when the government misconduct is so intentional and so egregious that a new trial is not an adequate remedy.” Instead, the court created a protocol through which “Dookhan defendants” could obtain relief. Ultimately, the protocol yielded the dismissal, with prejudice, of 21,839 wrongful convictions.

But, as the Massachusetts ACLU explains in a motion that it filed Wednesday with Committee for Public Counsel Services and Hampden County Lawyers for Justice, Farak’s case is different. Prosecutors were not only negligent in investigating the scope of Farak’s misconduct; they deliberately withheld exculpatory evidence from the defense, an egregious due process violation. In February 2013, after Farak’s arrest, the police provided documents found in her car to two assistant attorneys general. These statements, written in Farak’s handwriting, indicated that she had been using drugs at the lab since at least 2011. Previously, the attorney general’s office had “assumed” that Farak’s misconduct began in late 2012. (It reached this assumption without actually conducting an investigation into how long Farak used drugs at the lab. It later became clear that her use began much earlier.)

When the “Farak defendants” demanded that prosecutors turn over all potentially exculpatory evidence—a constitutional requirement—the attorney general’s office sought a protective order to keep this paperwork secret. The office also told the judge, as well as the defense, that evidence seized from Farak’s car was “irrelevant” to the Farak defendants, a blatant lie. The judge demanded that prosecutors provide him with the relevant documents for review. The attorney general’s office turned over some documents, but not Farak’s exculpatory statements. An assistant attorney general then falsely told the judge that she had provided “every document” that he asked for.

A dogged attorney named Luke Ryan continued to fight for access to evidence found in Farak’s car. The attorney general’s office resisted at every juncture, but Ryan eventually prevailed in court. In October 2014, he found the exculpatory statements and turned them over to the court. A month later, prosecutors finally released nearly 300 pages of undisclosed discovery from Farak’s car. By that point, the Supreme Judicial Court was mulling what to do with the Farak defendants’ convictions. Prosecutors did not inform the court about their previous false statements, and so the justices concluded that Farak’s behavior did not create a “conclusive presumption of egregious misconduct” for Farak defendants.

In December 2016, Superior Court Judge Richard J. Carey scheduled hearings to determine the actual scope of Farak’s misconduct and scrutinize prosecutorial misconduct. He found that two assistant attorneys general, Anne Kaczmarek and Kris Foster, had withheld exculpatory evidence “through deception,” “tampered with the fair administration of justice by deceiving [the court],” “distorted” the court’s fact-finding, and “unfairly hampered” the defense. Their “reprehensible” conduct, Carey concluded, “constitutes a fraud upon this court.”

When a case is dismissed with prejudice, it is dismissed permanently; prosecutors do not get a second try. Eighteen thousand dismissals with prejudice would certainly be a huge step for the Supreme Judicial Court. Yet the ACLU argues that such a drastic measure is necessary to right the astonishing wrongs committed by both Farak and prosecutors. Through their prevarications, the ACLU asserts, these prosecutors turned the lower court “into an instrument for unjustly denying discovery and remedies to wrongfully convicted people.” Their misconduct, along with Farak’s, is “entwined in proof of the charges” against Farak defendants. Precedent counsels that dismissal with prejudice is appropriate when prosecutors engage in misconduct that is “egregious, deliberate, and intentional, or that results in a violation of constitutional rights.” The remedy may also be deployed when a party commits “fraud on the court” in order to “protect the integrity of the courts” and “send an appropriate message.”

All of those factors are present here. The Supreme Judicial Court might be unnerved by the idea of reversing 18,000 convictions at the same time—but by this point, it is the only solution that could approximate some form of justice. Farak committed horrifying misdeeds for nearly a decade, and prosecutors compounded her crimes with fraud of their own. Most of the Farak defendants are already out of prison, but still living with the obstacles of their conviction. The Supreme Judicial Court should grant them the relief they deserved long ago and dismiss their cases with prejudice at once.