Purdue Pharma, the company that made billions selling the prescription painkiller OxyContin, filed for bankruptcy in White Plains, New York, days after reaching a tentative settlement with many of the state and local governments suing it over the toll of opioids.

The filing was anticipated before and after the tentative deal, which could be worth up to $12 billion over time, was struck.

"This settlement framework avoids wasting hundreds of millions of dollars and years on protracted litigation," Steve Miller, chairman of Purdue's board of directors, said in a statement, "and instead will provide billions of dollars and critical resources to communities across the country trying to cope with the opioid crisis. We will continue to work with state attorneys general and other plaintiff representatives to finalize and implement this agreement as quickly as possible."

But legal battles still lie ahead for Stamford, Connecticut-based Purdue, which is spending millions on legal costs as it defends itself in lawsuits from 2,600 government and other entities.

'Clearly a game': Opioid lawsuit settlements appear aimed at giving tax breaks to drug firms, experts say

Tentative settlement: OxyContin maker agrees to tentative opioids settlement but it falls short of national deal

Infographic: How companies turn government settlements into tax write-offs

About half the states have not signed onto the proposal and several of them plan to object to the settlement in bankruptcy court and to continue litigation in other courts against members of the Sackler family, which owns the company. The family agreed to pay at least $3 billion in the settlement plus contribute the company itself, which is to be reformed with its future profits going to the company's creditors.

In a statement, the families of late company owners Mortimer and Raymond Sackler said they have "deep compassion for the victims of the opioid crisis" and believe the settlement framework "is an historic step toward providing critical resources that address a tragic public health situation."

Objections came over the amount of the deal, which some officials say will not reach close to the $12 billion mark, and because it means the company won't be found liable by a jury or judge.The company that made billions selling OxyContin has filed for bankruptcy protection. This comes after it reached a tentative settlement with many governments. AP

Purdue chairman Miller said the company has not admitted wrongdoing and does not intend to. "The alternative is to not settle but instead to resume the litigation," he said on a conference call with reporters. "The resumption of litigation would rapidly diminish all the resources of the company and would be lose-lose-lose all the way around. Whatever people might wish for is not on the table now."

Because so many states balked at the settlement, it could complicate the bankruptcy process. The Sackler family members said they're still trying to get more states to sign on.

"We are hopeful that in time, those parties who are not yet supportive will ultimately shift their focus to the critical resources that the settlement provides to people and problems that need them," they said.

Key issues that could be decided include whether the suits against the Sacklers in state courts will be able to move ahead, and what will happen to the company itself. Under the tentative settlement deal, it would continue to operate, but with profits used to pay for the settlement. Another option could be for a judge to order it be sold.

Court filings assert 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.

A court filing by the New York Attorney General's office on Friday contended that Sackler family members used Swiss and other hidden accounts to transfer $1 billion to themselves. The discovery of the transfers bolsters several states' claims that family members worked to shield its wealth because of the growing legal threats against them and Purdue.

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.

The lawsuits assert that the company aggressively sold OxyContin as a drug with a low risk of addiction despite knowing that wasn't true.

Since OxyContin, a time-released opioid, was introduced in 1996, addiction and overdoses have surged. In both 2017 and 2018, opioids were involved in more than 47,000 deaths, according to the U.S. Centers for Disease Control and Prevention.

In recent years, there have been more deaths involving illicit opioids, including heroin and fentanyl, than the prescription forms of the drugs. That change has happened as awareness of the dangers of prescription opioids has increased and prescribers have become more cautious.

Purdue's drugs are just a slice of the opioids prescribed, but critics assign a lot of the blame to the company because it developed both the drug and an aggressive marketing strategy.

According to a lawsuit filed by the Massachusetts attorney general, the company pushed big sales of OxyContin from the start. Doing so meant persuading doctors who had been reluctant to prescribe such strong painkillers that this one was safe.

A court filing asserts that Richard Sackler, then a senior vice president in charge of sales at the company, told the sales force at a launch party for the drug: "The launch of OxyContin Tablets will be followed by a blizzard of prescriptions that will bury the competition. The prescription blizzard will be so deep, dense, and white."

Along with others in the industry, Purdue paid doctors who attested to the drug's safety and became a major funder of groups that advocated for pain patients and campaigned to have opioids prescribed.

The Associated Press and the Center for Public Integrity found the industry and groups it funded were also politically active, spending more than $880 million nationally on lobbying and campaigns from 2006 through 2015. That spending helped the industry fight off restrictions on prescribing the powerful painkillers.

All those issues are part of the lawsuits facing the drug industry now. The governments that are suing want reimbursement for costs associated with the opioid crisis and also funding for drug treatment and abuse-prevention programs.

In court filings, Purdue has pointed out that its products were approved by federal regulators and prescribed by doctors.

A federal judge overseeing close to 2,000 of the cases has been pushing the parties to reach a grand settlement that would make a difference in the opioid crisis. The judge, Cleveland-based Dan Polster, has scheduled a trial for the claims brought by Ohio's Cuyahoga and Summit Counties for October.

One lawyer who is suing Purdue on behalf of clients including the city of Albuquerque, New Mexico, and the state of Utah, which has signed on to the tentative settlement, said it's long been a consideration that Purdue could not afford to pay the massive amounts being sought in the lawsuits.

"I don't think there's enough money in that company to pay for the damages that are claimed," said Jonathan Novak.

That is one reason there are other defendants in most opioid lawsuits, he said, including members of the Sackler family and huge drug distribution companies such as McKesson Corp. and Cardinal Health. State and local governments have also been battling over how any national settlements would be distributed.

Organizations facing big lawsuits have a long history of bankruptcy claims.

Dozens of asbestos companies have done so since the 1980s. Last year, USA Gymnastics filed for protection as it faced lawsuits over sexual abuse by team doctor Larry Nassar.

Earlier this year, Pacific Gas & Electric Corp. sought bankruptcy protection because it faces billions of dollars in potential damages from lawsuits over catastrophic wildfires in California.

And in June, another company that makes opioids, Insys Therapeutics, filed for bankruptcy just days after reaching a $225 million settlement with the federal government over a kickback scheme. Now, a bankruptcy judge will have to sort out how much of that will be paid.

Vincent Buccola, a lawyer and professor of business ethics, said Purdue may be trying to avoid going to court in states that have been deeply harmed by the opioid epidemic.

"That's not the jury you want to face," said Buccola, who teaches at the University of Pennsylvania. "So you might try to stop that litigation from happening and consolidate it in front of bankruptcy judge who you hope will be more favorable."

Associated Press reporter Matthew Perrone in Washington contributed to this report.