U.S. cities and counties are increasingly at odds with their own state governments over how to divvy up $641.5 million that consulting firm McKinsey & Co. has offered to settle its liability for work with the opioid industry.

In the past two months, McKinsey reached final agreements with all 50 states to resolve lawsuits claiming it helped boost sales of the addictive drugs. But since then, more than 20 cities, counties and Native American tribes have sued the consultant, hoping for their own payouts. Local governments in New York even sought to block the state's pact with McKinsey because it would harm their separate suits against the firm.

McKinsey says almost all the states agreed that the deal they signed covers any other claims, setting up a legal fight between the company and local governments pressing ahead with their cases. At the heart of the dispute is who decides the fate of money intended to combat addiction and crime linked to the U.S. opioid crisis that's killed hundreds of thousands of people.

"There's going to be a lot of litigation," said Alexandra Lahav, a University of Connecticut law professor who specializes in mass tort cases. "Every state takes its own view of the powers an attorney general has to resolve claims on behalf of local governments within the state's borders."

The outcome could have wider implications. Thousands of cities and counties are pursuing opioid lawsuits against drug makers like Johnson & Johnson and distributors like McKesson Corp. While lawyers for local governments are participating in settlement discussions with those defendants, the widening rift between states and municipalities could complicate future talks with companies that remain holdouts -- including pharmacy owners such as Walmart Inc., CVS Health Corp. and Rite Aid Corp.

Local officials like Thomas Haine, the state prosecutor in Madison County, Illinois, want to avoid opioid litigation becoming a repeat of the 1998 settlement that ended smoking-related litigation, where much of the $246 billion that tobacco makers paid ended up in state general funds. His county of 263,000 people outside St. Louis sued McKinsey in February, just days before Illinois agreed to accept $19.8 million from the firm.

That amount is "a pittance when you quantify the damages caused by their actions," Haine said in an interview. "I felt we owed it to the taxpayers of Madison County, who have shouldered a heavy burden in dealing with the opioid crisis, to seek recovery from every party potentially at fault."

A growing number of local officials are also pursuing separate claims against McKinsey, including King County, Washington; Montgomery County, Ohio; Pembroke Pines, Florida; Green County, Kentucky; and Mingo County, West Virginia -- one of the states hit hardest by the opioid epidemic.

McKinsey says its deal with the states means no additional payments or settlements are necessary.

"The state attorneys general are the chief law enforcement officers for their states and are in charge of managing investigations and settlements such as this one," D.J. Carella, a McKinsey spokesman, said in an email. "The funds provided by this settlement will be used by the state governments to support communities throughout those states."

The authority of the state to act on behalf of municipalities stems from a legal doctrine known as parens patriae which grants power to the state to protect its citizens, said Michelle Richards, a law professor at the University of Detroit Mercy in Michigan. That could mean separate claims for opioid cash by cities and counties may have a hard time surviving in court, she said.

Only two state attorneys general, Washington's Robert Ferguson and West Virginia's Patrick Morrisey, insisted that their deals with the consulting company wouldn't prohibit local officials from bringing their own lawsuits, according to McKinsey.

In New York, where Attorney General Letitia James accepted $32 million of the McKinsey accord, the question of whether the agreement prevents local officials from suing came up court hearings in February and March involving McKinsey, the state and municipalities.

According to a transcripts from the hearings, lawyers for the counties wanted the same assurances as Washington and West Virginia that they could pursue their own claims. David Nachman, a lawyer for New York, told the judge the deal did not block local claims, "but we also understood that McKinsey" may argue that it does. "We have not in any way interfered with the Counties' rights."

Hunter Shkolnik, a lawyer for several New York counties with opioid suits, said in an email that "McKinsey is flat wrong to believe the $641 million they paid the states wipes out all their opioid liability."

Massachusetts in 2019 claimed McKinsey advised drug maker Purdue Pharma how to "turbocharge" sales of its OxyContin painkiller at a time when the legitimate market for the highly addictive pills was shrinking. McKinsey worked for other opioid makers, including Johnson & Johnson and Endo International, though it has since said it would no longer advise companies that produce pain pills.

It's unlikely many opioid companies will take as hard a line as McKinsey on negotiating opioid deals, especially if they want universal settlements, said Eli Savit, a University of Michigan law professor who has written about the conflicting rights of states and local government litigation. The strategy isn't attractive because it "won't give them any finality" as cities and counties pursue their own lawsuits, Savit said.

Some states already have worked out agreements with municipalities about how to allocate opioid settlements. In Ohio, all recoveries will be turned over to a foundation, which will distribute funds based on the per capita number of opioid deaths in an area. Similar plans are in place for other states, including Texas and New Hampshire.

They may soon have billions to distribute. J&J and drug distributors McKesson Corp., Cardinal Health Inc. and AmerisourceBergen Corp. are offering to pay a total of $26 billion to settle their liability -- including with cities and counties -- though the deal hasn't been finalized.

Cases filed by Native Americans tribes, considered the legal equivalent of states, pose an greater risk for McKinsey and others hoping to only negotiate with state attorneys general, Richards said. Among those with new suits against the consulting company are the Kenaitze tribe in Alaska and the Cherokee Nation in Oklahoma.

"The states have been quite dismissive of the tribes' efforts to position themselves to get a fair share of these settlements," giving them more incentive to push separate claims after the opioid epidemic caused disproportionate suffering in their communities, said Lloyd Miller, a lawyer for the groups.

"Everyone involved in this opioid mess needs to be held accountable for their part in the profiteering, strategizing and conspiracy in creating and sustaining this crisis," said Dr. Aaron Payment, chairman of the Michigan-based Sault Ste. Marie Tribe of Chippewa Indians.