According to insiders, the pharmacy chains CVS, Walgreens Boots and Walmart have agreed on a payment of around 13.8 billion dollars in the dispute over the mass abuse of painkillers in the USA.

The settlement provides that CVS will pay around $5 billion over 10 years and Walgreens around $5.7 billion over 15 years, the two companies said on Wednesday.

Neither group has admitted to wrongdoing.

Walmart is paying $3.1 billion, mostly upfront, two people familiar with the matter told Reuters.

The companies want to settle thousands of lawsuits from US states and local governments that accuse the chains of having exacerbated the opioid crisis in the US.

Walgreens declined to comment.

Paul Geller, one of the attorneys negotiating for the governments, said the settlement with the pharmacies will bring billions of additional dollars to communities desperate for means to fight the epidemic.

"We know that reckless, profit-driven dispensing practices have fueled the crisis, but we also know that with better systems and proper heed of warnings, pharmacies can play a direct role in reducing opioid abuse and saving lives."

The opioid crisis has resulted in nearly 650,000 overdose deaths in the United States since 1999.

CVS, Walgreens and Walmart are the three largest pharmacy chains in the country by market share.

If their settlement becomes final, much of the lengthy, years-long opioid litigation will end.

However, cases are still pending against smaller, more regionally oriented pharmacy operators such as Rite Aid and Kroger.

Previous settlements raised $26 billion from the three largest US drug makers McKesson, Cardinal Health, AmerisourceBergen and Johnson & Johnson, $4.35 billion from Teva and $2.37 billion from AbbVie.

The pharmaceutical company Purdue Pharma, whose prescription pain reliever OxyContin is blamed for causing the crisis, and its owning Sackler family are trying to resolve the opioid claims against them in a $6 billion bankruptcy court settlement.

The authorities want to use the money from the settlements to fight the opioid crisis.