The proposed settlement would be the first nationwide deal with retail pharmacy companies

(Reuters) – CVS Health Corp (CVS.N), Walgreens Boots Alliance Inc (WBA.O) and Walmart Inc (WMT.N) agreed to pay about $13.8 billion to resolve thousands of U.S. state and local lawsuits accusing the pharmacy chains of mishandling opioid pain drugs, potentially bringing years of litigation close to the finish line.

CVS said on Wednesday it had agreed to pay about $5 billion over 10 years, and Walgreens said that it had agreed to pay about $5.7 billion over 15 years. Neither company admitted wrongdoing. Walmart has agreed to pay $3.1 billion, mostly up front, according to two people familiar with the matter.

Paul Geller, one of the lawyers who negotiated for the governments, said that settlements with pharmacies “will bring billions of additional dollars to communities that are desperate for funds to combat the epidemic” of opioid addiction.

“We know that reckless, profit-driven dispensing practices fueled the crisis; but we know just as surely that with better systems in place and proper heeding of red flag warnings, pharmacies can play a direct role in reducing opioid abuse and in saving lives,” Geller said.

CVS general counsel Thomas Moriarty said in a statement the company was pleased to resolve the claims and the deal was “in the best interest of all parties, as well as our customers, colleagues and shareholders.”

Walgreens in a statement said: “As one of the largest pharmacy chains in the nation, we remain committed to being a part of the solution, and this settlement framework will allow us to keep our focus on the health and wellbeing of our customers and patients, while making positive contributions to address the opioid crisis.”

Both CVS and Walgreens said their agreements would not be final until certain non-monetary terms were worked out, and that the total amount could be reduced if not enough government plaintiffs sign on.

Walmart did not immediately respond to a request for comment.

The proposed settlement, which would be the first nationwide deal with retail pharmacy companies, follows nationwide opioid settlements with drug makers and distributors totaling more than $33 billion. read more