CVS Health has announced an agreement in principle that would make it the first major pharmacy chain to reach a nationwide settlement of lawsuits over how it handled prescriptions for powerful and addictive prescription opioid painkillers that are linked to an overdose epidemic.The Woonsocket, Rhode Island company would pay about $5 billion over 10 years under a deal that, if accepted, would be one of the largest settlements over the crisis. Other pharmacies, including Rite Aid, Walgreens and Walmart have reached agreements with individual states.CVS announced its proposed deal Wednesday as it released its quarterly earnings. The company did not admit liability or wrongdoing and said that nonfinancial terms remain to be resolved.’We are pleased to resolve these longstanding claims and putting them behind us is in the best interest of all parties, as well as our customers, colleagues and shareholders,’ Thomas Moriarty, the CVS chief policy officer and general counsel said in a statement. ‘We are committed to working with states, municipalities and tribes, and will continue our own important initiatives to help reduce the illegitimate use of prescription opioids.’The company has launched educational programs and installed safe disposal units for drugs in stores and police departments, among other measures designed to reduce misuse of opioids.In the lawsuits, governments said pharmacies were filling prescriptions that they should have flagged as inappropriate.Under the settlement plan, CVS would pay $4.9 billion to state and local governments and about about $130 million to Native American tribes over the next decade. The exact amount would depend on how many governmental entities accept the terms of the deal.The proposed settlement brings a nationwide tally of finalized and completed settlements between companies and governments to more than $45 billion. Under terms of the deals, most of the money must be used to address the continuing epidemic.Opioids have been linked to more than 500,000 deaths in the U.S. over the past two decades. Most of the deaths initially involved prescription drugs. As governments, doctors and companies took steps to make them harder to abuse and obtain, people with opioid use disorder increasingly switched to heroin, which proved more deadly.In recent years, opioid deaths have soared to record levels around 80,000 a year. Most of those deaths involve illicitly produced version of the powerful lab-made drug fentanyl, which is appearing throughout the U.S. supply of illegal drugs.The settlement was announced as litigation over the role of pharmacies in the opioid crisis has ramped up. On Tuesday, 18 companies – most of them pharmacy-related – submitted reports to a judge overseeing opioid litigation detailing where they face lawsuits.Only a handful of opioid settlements have had bigger dollar figures attached than the CVS plan. Distributors AmerisourceBergen, Cardinal Health and McKesson this year finalized a combined settlement worth $21 billion and drugmaker Johnson & Johnson finalized a $5 billion deal.Purdue Pharma, the maker of OxyContin, and members of the Sackler family who own the company, have a proposed settlement that would involve up to $6 billion in cash plus the value of the company, which would be turned into a new entity with its profits used to combat the epidemic. That plan has been put on hold by a court.