HARTFORD, Conn. - A tentative settlement announced Wednesday over the role Purdue Pharma played in the nation's opioid addiction crisis falls short of the far-reaching national settlement the OxyContin maker had been seeking for months, with litigation sure to continue against the company and the family that owns it.

The agreement with about half the states and attorneys representing roughly 2,000 local governments would have Purdue file for a structured bankruptcy and pay as much as $12 billion over time, with about $3 billion coming from the Sackler family. That number involves future profits and the value of drugs currently in development. In addition, the family would have to give up its ownership of the company and contribute another $1.5 billion by selling another of its pharmaceutical companies, Mundipharma.

Several attorneys general said the agreement was a better way to ensure compensation from Purdue and the Sacklers than taking their chances if Purdue files for bankruptcy on its own.

Arizona Attorney General Mark Brnovich said the deal “was the quickest and surest way to get immediate relief for Arizona and for the communities that have been harmed by the opioid crisis and the actions of the Sackler family.”

Opioid addiction has contributed to the deaths of some 400,000 Americans over the past two decades, hitting many rural communities particularly hard.

The lawsuits against Stamford, Connecticut-based Purdue paint it as a particular villain in the crisis. They say the company's aggressive marketing of OxyContin downplayed addiction risks and led to more widespread opioid prescribing, even though only a sliver of the opioid painkillers sold in the U.S. were its products.

The tentative agreement and expected bankruptcy filing would remove Purdue from the first federal trial over the opioids epidemic, scheduled to begin next month in Ohio.

Even with Wednesday's development, many states have not signed on. Several state attorneys general vowed to continue their legal battles against the company in bankruptcy court and the Sacklers. Roughly 20 states have sued members of the Sackler family in state courts.

Connecticut, Massachusetts, Nevada, New York, Pennsylvania, North Carolina and Wisconsin are among the states saying they were not part of the agreement.

“Our position remains firm and unchanged and nothing for us has changed today,” Connecticut Attorney General William Tong said in a statement.

“The scope and scale of the pain, death and destruction that Purdue and the Sacklers have caused far exceeds anything that has been offered thus far,” Tong said. “Connecticut's focus is on the victims and their families, and holding Purdue and the Sacklers accountable for the crisis they have caused.”

He said the state would continue to pursue Purdue if it files for bankruptcy under the settlement agreement, as expected.

Pennsylvania Attorney General Josh Shapiro called the tentative deal “a slap in the face to everyone who has had to bury a loved one due to this family's destruction and greed.”

He said he intends to continue fighting the Sacklers, who he said did not have to acknowledge any wrongdoing in their agreement.

“This is far from over,” he said.

The announcement of a partial deal came just days after a group of attorneys general negotiating directly with Purdue and the Sacklers said they had reached an impasse in talks. At the time, several attorneys general said they were not confident Purdue would pay the amount promised and wanted more assurance that the money would come through.

In the latest settlement agreement, New York Attorney General Letitia James accused the Sacklers of “attempting to evade responsibility and lowball the millions of victims of the opioid crisis.”

There was no immediate response from Purdue, and attempts to reach members of the Sackler family were not immediately successful. In court filings, Purdue has pointed out that its products were approved by federal regulators and prescribed by doctors.

Some 2,000 lawsuits brought by local governments, Native American tribes, unions and hospitals have been consolidated under a federal judge in Cleveland, who has been encouraging the parties to settle. U.S. District Court Judge Dan Polster invited state attorneys general, who had filed their own lawsuits, to lead the negotiations.

How any money from the settlement will be divided among all the entities is not entirely clear. Nevertheless, the attorneys representing the local governments issued a statement saying they recommended the governments agree to the deal as a way to bring relief to their communities.

In March, Purdue and members of the Sackler family reached a $270 million settlement with Oklahoma to avoid a trial on the toll of opioids there.

A court filing made public in Massachusetts this year asserts that members of the Sackler family were paid more than $4 billion by Purdue from 2007 to 2018. Much of the family's fortune is believed to be held outside the U.S., which could complicate lawsuits against the family over opioids.

The Sacklers have given money to cultural institutions around the world, including the Smithsonian Institution, New York City's Metropolitan Museum of Art and London's Tate Modern.

Mulvihill reported from New Jersey. Associated Press writer Jonathan J. Cooper in Phoenix contributed to this report.