CHARLESTON, W.Va. (AP) — Communities in West Virginia say they would get $1.25 billion from the drug industry in a proposed settlement that would end most of the litigation stemming from the opioid crisis in the state.

The deal would be the first of its kind, even as drug makers, distribution companies and pharmacies are considering settling about 3,000 lawsuits nationwide over what many — including the families of those who died of opioid addiction — say was their role in fueling a crisis that has been linked to more than 430,000 deaths in the U.S. since 2000.

Paul Farrell, a West Virginia-based lawyer who is one of the leaders in the lawsuits nationwide, said governments in his state have agreed to the deal that was hammered out by 250 lawyers in a Charleston office building last week.

Farrell said the companies would have to determine how much each would pay and officials in West Virginia still have to figure out how to divide the money among the state and local governments, hospitals and other entities. A panel of judges could be called in to settle the allocation formula if there are disagreements.

Lawyers’ fees would not come out of the $1.25 billion. Rather, they would be an additional amount set by the West Virginia Mass Litigation Panel, which is made up of state judges.

How to handle payments for lawyers has been a factor in a split among states over whether to enter a national settlement over opioids with three major distributors plus the drug makers Johnson & Johnson and Teva.

“I’ve solved the attorney fee problem by handing it over to the court,” Farrell said Monday. He would not comment on details of the talks surrounding the proposal.

Left out of the potential state deal would be state Attorney General Patrick Morrisey’s claims against drug makers. Morrisey would be able to continue those lawsuits or reach separate settlements — possibly as part of national deals.

The West Virginia plan also does not apply to two key drug makers, Purdue Pharma and Mallinckrodt. Both are attempting to settle opioid lawsuits they face through bankruptcy court.

Farrell said West Virginia was seeking its own deal partly because the state would be cut out of a piece of a national $18 billion settlement that’s under consideration with the three dominant distribution companies, AmerisourceBergen, Cardinal Health and McKesson.

The state has already settled lawsuits with those companies over the past three years for a total of $63 million. West Virginia also settled with a group of smaller wholesalers in 2016 for $11 million.

The West Virginia plan would be the first statewide opioid settlement with companies from all parts of the drug industry. West Virginia has the country’s highest fatal opioid overdose rate.

A spokesman for McKesson issued a statement saying the company is still working toward a global settlement “that would serve as the best path forward by providing billions of dollars in near-term funding, as well as vast amounts of free medication to aid in treatment and provide relief to the communities that need it now, including West Virginia.”

Officials in Ohio have been working on a plan for how to divide money among government entities if they reach a settlement, either as part of a national effort or separately.

The timeline for accepting the West Virginia plan should become clearer this week. Farrell said the companies would have until the start of a federal trial expected in coming months over claims from the city of Huntington and Cabell County against the major distributors. A judge is expected to set a date for it during a hearing Thursday.