Members of the Sackler family involved in the creation of OxyContin and their company Purdue Pharma reached a settlement with U.S. states to pay as much as $6 billion to end litigation over the company’s role in the opioid epidemic.

The Sacklers will pay at least a billion dollars more than originally proposed, after many states and the District of Columbia rejected a previous settlement with the Sacklers and company for $4.3 billion cash last year.

The new settlement, which has yet to be approved by a judge, would mean $20 million in funds for Massachusetts, according to Attorney General Maura Healey, who was highly critical of the original deal.

“I am glad to see a resolution in this case and am grateful for the mediator’s efforts,” said Healey in a statement. “It’s time to deliver results: to expose the Sacklers’ secrets, pay compensation to the families who were hurt, and commit billions to harm reduction, treatment, and recovery.”

Today’s announcement is the latest in a multi-state case against Purdue and the Sacklers. As a result, every state has now consented to Purdue’s bankruptcy plan.

Other terms previously won by Healey last July were secured, including the disclosure of more than 30 million Purdue documents that could paint an accurate picture of what really happened to launch an opioid epidemic that continues to ravage the nation.

In addition, all of the funds from the settlement will go to prevention, harm reduction, and treatment, and a $750 million fund will compensate survivors and families nationwide impacted by opioids.

While the Sackler family will be protected from civil lawsuits as a result of the settlement, it does not shield members of the Sackler family from criminal charges.

Members of the Sackler family have long denied wrongdoing, which was demonstrated in their Thursday afternoon statement on the settlement.

“The families have consistently affirmed that settlement is by far the best way to help solve a serious and complex public health crisis," wrote spokespeople for descendants of Drs. Raymond and Mortimer Sackler. “While the families have acted lawfully in all respects, they sincerely regret that OxyContin, a prescription medicine that continues to help people suffering from chronic pain, unexpectedly became part of an opioid crisis that has brought grief and loss to far too many families and communities.”

Purdue Pharma itself filed for Chapter 11 protection in 2019 following the filing of thousands of lawsuits claiming the company and family had used deceptive marketing practices to get people to take OxyContin, fueling the epidemic.

Purdue plead guilty to fraud and misbranding charges in that marketing in 2007 and 2020. On Thursday, the company told GBH in an email that it is pleased with the settlement achieved in mediation.

“With this mediation result, we continue on track to proceed through the appeals process on an expedited schedule, and we hope to swiftly deliver these resources,” company media representatives wrote. “Under which all of the additional settlement funds will be used for opioid abatement programs, overdose rescue medicines, and victims.”

The 20-page deal must still be approved by Bankruptcy Judge Robert Drain.