Two prisoners will be able to continue receiving addiction treatment medication and a third will have his medication reinstated until a January hearing, under an agreement reached in federal court Monday afternoon.

The American Civil Liberties Union of Massachusetts and the law firm Goodwin Procter LLP filed suit against the Department of Correction last Thursday, alleging that the three plaintiffs had been receiving prescribed daily doses of buprenorphine to treat opioid use disorder, but learned from prison medical providers that that course of treatment would end after 90 days because of the department's "compulsory-withdrawal policy."

The lawsuit, Sclafani v. Mici, argues that the department is violating the Eighth Amendment's ban on cruel and unusual punishment, as well as protections afforded under the Americans with Disabilities Act.

According to the ACLU, the department has already discontinued Joseph Sclafani's buprenorphine prescription and has plans to discontinue treatment for the other two plaintiffs in the next few weeks -- around Dec. 30 for Bret Cappola and around Jan. 6 for Michael Feinstein. Sclafani is currently incarcerated at MCI Norfolk and Cappola and Feinstein are being held at MCI Cedar Junction in Walpole.

Lawyers from both sides appeared before U.S. District Court Judge Indira Talwani, where they agreed to maintain Cappola and Feinstein's treatment at their current doses until a preliminary injunction hearing scheduled for January, and to start the induction process to put Sclafani back on medication-assisted treatment after an evaluation that could take place on Tuesday. If the dosage needs to be changed for medical reasons, the Department of Correction is to notify the plaintiffs' counsel immediately.

"We're relieved to hear that our clients are going to be maintained, or in the case of Mr. Sclafani, put back on their prescribed buprenorphine treatment," ACLU staff attorney Jessie Rossman told reporters after the hearing. "What happened today was a temporary relief, and we're looking forward to continuing the conversation in court in the middle of January."

Philip Silva, the counsel for the Department of Correction, declined to be interviewed after the hearing.

A law Gov. Charlie Baker signed in August 2018 included language to ensure prisoners and detainees in some Department of Correction facilities could continue receiving medication-assisted treatment while behind bars if they'd been already prescribed it, and establishing a medication-assisted treatment pilot program in county jails.

In court filings, the ACLU -- which has previously filed other lawsuits related to medication-assisted treatment access in Massachusetts correctional facilities -- cited a 2017 Department of Public Health study showing that the opioid overdose death rate is 120 times higher for those recently released from incarceration compared to the rest of the adult population.

"This case, of course, is on behalf of our three plaintiffs, but we certainly hope it encourages the Department of Corrections to make sure that everyone has access to their medication," Rossman said. "Addiction is a disease, and we need to treat it as such, with health care."

ACLU of Massachusetts executive director Carol Rose said in a statement that the organization hopes "that jails and prisons everywhere change their policies to ensure people in their custody suffering from opioid use disorder have access to medically prescribed treatment."