The yearslong effort by state and local governments in the U.S. to force the pharmaceutical industry to help pay to fix a nationwide opioid addiction and overdose crisis took a major step forward Tuesday when lawyers for local governments announced they were on the verge of a $26 billion settlement with the nation’s three biggest drug distribution companies and the drugmaker Johnson & Johnson.

Under the deal, Johnson & Johnson would not produce any opioids for at least a decade. And AmerisourceBergen, Cardinal Health and McKesson share prescribing information under a new system intended to stop the avalanches of pills that arrived in some regions about a decade ago.

Lawyers for local governments said full details could be shared within days. That would not be the end of the deal though; each state would have 30 days to decide whether to join. And local governments will have five months after that to decide. If governments don’t opt in, the settlement total would go down.