Groups representing Minnesota counties and local governments have struck a deal to divide up the state's portion of a massive opioids settlement, an agreement that would send tens of millions of dollars to communities ravaged by overdoses of the powerful narcotics.

This is the latest — but not last — step toward Minnesota receiving more than $300 million to respond to the state's opioid crisis. The money could be used for addiction recovery programs, law enforcement, child protection, treatment, intervention, education and other expenses associated with an epidemic that has cost the state thousands of lives and millions of dollars in the past two decades.

"We have to talk about finances, we have to talk about the dollars but when all of it sifts out, it's about improving lives," said Gov. Tim Walz during the Association of Minnesota Counties' annual conference on Monday, when he announced the agreement.

The Minnesota plan would give 75% of the money to localities and 25% would go into the state's coffers. A panel convened by Minnesota Attorney General Keith Ellison that included health practitioners and first responders helped arrive at that breakdown. Further details on how cities and counties would divide their share of the settlement dollars is expected later this week.

The Association of Minnesota Counties, League of Minnesota Cities and Coalition of Greater Minnesota Cities agreed to the formula. But individual county and local units of government must still sign on by the end of the year to maximize the amount of money the state could get under the terms of a previously announced settlement with pharmaceutical giant Johnson & Johnson and three drug distributors. Otherwise, according to the Attorney General's Office, Minnesota's share could be reduced by as much as half.

"This is a historic opportunity to invest in public health, human services, and public safety initiatives that address the opioid epidemic and work towards preventing the impact of addiction in the future, said Association of Minnesota Counties President Rich Sve.

Ellison said Monday that the agreement would "extract the maximum amount of money we can from these companies and get it to where the pain is, so we can address the suffering of families and communities in every part of our state as quickly as possible — provided that counties and cities approve the agreement."

State Rep. Dave Baker, a Willmar Republican who is interim chair of the Opioid Epidemic Response Advisory Council, said Monday that the "exhaustive agreement" between counties, cities and the state gives the state "a path forward for deploying dollars that will help families and communities who were devastated by this crisis and help save lives in the future."

Minnesota and 41 other states joined the settlement earlier this year, which is valued at about $26 billion. The roughly $300 million that would go to Minnesota would be spread out across 18 years. In Minnesota, 26 counties and seven cities also previously filed their own opioid-related lawsuits amid skepticism that any money won by the state in court would reach them.

The Minneapolis City Attorney's Office said in a statement Monday that it is reviewing the settlements and the proposed state and local entity distribution agreement. The City Council may vote on whether to join the agreement as soon as Friday.

The companies have said enough states have signed on for them to continue pursuing the deal. But if they later conclude that an insufficient number of counties and cities have signed on, more than 3,000 lawsuits may be sent back to their home courts, where trials could take years.

Ellison's office is expected to lobby the Legislature this year to eliminate two provisions in recently passed opioid response legislation. One provision, passed before the settlement agreements, concerns how much leftover state money for opioid-related appropriations must be sent to counties. Another requirement holds that the state must have at least $250 million in its opioid response fund before it can begin distributing the money.

Minnesota could also receive as much as $50 million through a massive settlement in a separate lawsuit involving Purdue Pharma and the Sackler family that controlled the opioid giant. The state is expected to follow a similar state-local allocation formula with the Purdue settlement money.

The Sackler family is also required to turn over more than 30 million documents said to detail Purdue Pharma's role in the country's opioid crisis.

"Full transparency is also critical" in the case involving Johnson & Johnson, said Baker on Monday. "We must understand how these companies misled the medical industry so that this can never happen again," Baker said.

Staff writer Katie Galioto contributed to this report.