Four of the biggest drug companies in the world have agreed to pay $26 billion to settle an opioid crisis lawsuit.

According to NBC News, a group of state attorneys general confirmed the landmark deal Wednesday, after years of negotiations with Johnson & Johnson and drug distributors AmerisourceBergen Corp., Cardinal Health Inc., and McKesson Corp. The companies are accused of fueling the nation’s epidemic of opioid addiction, which reportedly resulted in more than half a million drug overdose deaths from 2009 to 2019.

The settlement was the result of a bipartisan effort that included the attorneys general from Tennessee, North Carolina, Pennsylvania, Louisiana, Delaware, Connecticut, and New York. The deal must be approved by more than 40 states and hundreds of local governments before it can resolve hundreds of claims and lawsuits filed in both federal and state courts. If approved, J&J will pay $5 billion over a nine year period, while AmerisourceBergen and Cardinal Health will each pay $6.4 billion over 18 years, and McKesson will pay $7.9 billion over 18 years.

NBC News reports the money will go toward the fight against opioid addiction, as it will fund various social services such as prevention, treatment, and educational programs. The deal does not include an admission of liability or wrongdoing.

“Today, we are holding these companies accountable and infusing tens of billions of dollars into communities across the nation, while taking significant steps to hold these companies accountable …” New York state Attorney General Letitia James said in a statement Wednesday. “While no amount of money nor any action can ever make up for the hundreds of thousands of lives lost or the millions more addicted to opioids, we can take every action possible to avoid any future devastation.”

Under the agreement, J&J will stop selling prescriptions opioids and halt funding for third-party entities that promote the substance. The three drug distributors will also be required to share aggregated distribution data in effort to prevent over-supplying certain regions with painkiller medications.

“We recognize the opioid crisis is a tremendously complex public health issue, and we have deep sympathy for everyone affected,” Michael Ullmann, J&J’s executive vice president and general counsel, said in a statement. “This settlement will directly support state and local efforts to make meaningful progress in addressing the opioid crisis in the United States.”