WASHINGTON — Top legal officials in 27 states and territories and lawyers for more than 2,000 cities and counties announced Wednesday they had agreed to a tentative multi-billion-dollar settlement with Purdue Pharma, the maker of the opioid OxyContin, for its role in the opioid crisis.

At least 21 other attorneys general who are suing the drug company, however, told NBC News they have not agreed to the deal with Purdue Pharma and the Sackler family, which owns the firm.

Under terms of a plan first reported by NBC News in August, the Sackler family would give up control of Purdue, which would then declare bankruptcy and be converted into a for-profit trust. The proceeds from the sale of drugs would go to the plaintiffs, who include more than 45 states and territories and nearly 2,300 cities and counties. The whole deal, which includes additional money from the Sacklers, is valued at $10 billion to $12 billion.

In a statement Wednesday, the Tennessee Attorney General's Office said that it was part of a bipartisan group of 27 attorneys general that "agreed to a framework to resolve claims against Purdue Pharma and the Sackler family."

Earlier, the Arizona AG's office released a similar statement that said it had agreed to a tentative settlement along with "at least 25 other bi-partisan states and territories."

The group of lawyers representing the cities and counties suing Purdue issued its own statement saying it had agreed to recommend approval of the deal to its clients.

NBC News attempted to contact every state and territory involved in the suit and got answers from 42. The attorney general's offices in 21 states and territories said they favor the deal, while 20 states and D.C. said they oppose it.

The opinions split largely on party lines. All but two of the attorneys general who told NBC News they are against the deal are Democrats, while all but four of the attorneys general in favor are Republicans.

On Wednesday, Minnesota Attorney General Keith Ellison said, "Minnesota is not part of the apparent settlement that was leaked despite the federal gag order. ... [I]t may be worth far less than media reports say and seems to be not yet good enough for the magnitude of the death and destruction Purdue and the Sacklers caused."

The attorney general of North Carolina, who opposes the deal, issued a statement saying that a "large number of states" think the Sackler family needs to guarantee more money.

"We believe they created a mess and must help to clear it up," said Attorney General Josh Stein. "I am now preparing filings to sue the Sackler family."

"Different states have different views, as is to be expected. But every Attorney General agrees that Purdue, the Sacklers, and other drug companies need to pay to treat those struggling with addiction."

On Thursday, the attorney general of Pennsylvania, who opposes the deal, filed a new, separate suit against the Sacklers.

The Sackler family said Wednesday it "supports working toward a global resolution that directs resources to the patients, families and communities across the country who are suffering and need assistance. This is the most effective way to address the urgency of the current public health crisis, and to fund real solutions, not endless litigation."