WHITE PLAINS, N.Y. — Citing mounting costs of litigation that are siphoning funds that could otherwise go to abate the opioid crisis, a bankruptcy judge on Friday ordered a pause in legal action by states against Purdue Pharma and its owners, the Sacklers.

The ruling was a setback for 25 states that have forcefully opposed a national opioid settlement negotiated last month among the company and the Sacklers and cities, counties and other states that have filed lawsuits against them. To raise money for the settlement, Purdue has filed for Chapter 11 bankruptcy and asked that all litigation against it and the Sacklers be halted.

At the end of a seven-hour hearing, Judge Robert D. Drain of the United States bankruptcy court in White Plains, N.Y., pushed the parties to a compromise to address the opposing states’ key concerns. Rather than stopping the lawsuits altogether, as is customary in bankruptcy, he gave all the parties until Nov. 6 to come up with a disclosure plan. It would assure that the Sacklers reveal how much money they have earned from the sales of the opioid painkiller OxyContin, and that an angry public would eventually learn the complete story of the company’s role in the opioid epidemic.

For much of the hearing, lawyers for various states and municipalities objected to the suspension of their cases that bankruptcy typically imposes. They said halting their lawsuits would make it impossible for them to fulfill their duty to get to the bottom of the opioid crisis, hold the appropriate parties accountable and make health care regulation in their jurisdictions more effective for the future.

Midway through the hearing, Judge Drain became testy and openly challenged the implication that those goals could not be achieved in federal bankruptcy court as well.

“No one wastes time in front of me!” he shouted at one point. “Everyone, the debtor first and foremost, would engage in good faith” if all the various state court proceedings were halted and conducted under the bankruptcy rules instead.

He added that he did not think the state lawsuits would produce the sought-after factual records of the opioid crisis, or an enforceable settlement that would put money into the hands of those most in need. When the states took on the tobacco companies and negotiated payments for health care, he pointed out, most of their legislatures ended up diverting the money to plug holes in their budgets.

“That could not happen in a bankruptcy plan, because a bankruptcy plan is binding,” Judge Drain said.

But at the end of the day, the compromise plan was designated as voluntary, to assuage concerns about a federal judge imposing his will on states, which by law are sovereign.

Many states made clear afterward that they had agreed grudgingly, however.

“We are disappointed by the court’s ruling, but pleased that it is limited in time to less than 30 days,” said William Tong, the attorney general of Connecticut. “We will use this time to ensure that we get access to the Sacklers’ financial information and will be ready on Nov. 6 to make our case to hold Purdue and the Sacklers accountable.”

Under the tentative national settlement reached last month with lawyers representing two dozen states and about 2,000 counties, cities and tribes that have sued in federal court, the Sacklers would have seven years to contribute $3 billion to the plaintiffs, and to sell Mundipharma, their British pharmaceutical company. They would also give up ownership of Purdue, which would be restructured into a new company, overseen by public administrators.

The new company would continue to sell its signature opioid, OxyContin, as well as other medications, but all profits would go to pay the cities, counties and states for the costs of the opioid epidemic. Purdue would also contribute several drugs in its pipeline designed to treat addiction and overdoses.

Another condition, revealed in court filings this week, is that agreement by the plaintiffs also hinges on what financial terms Purdue eventually reaches with the Department of Justice.

But some two dozen states, the District of Columbia and a group of some 500 municipalities and tribes are denouncing the deal, particularly for the Sacklers’ role in it. They say the Sacklers’ proposed contribution is too small and takes too long to pay out. They also oppose the idea that the settlement funds would be raised in part by continuing sales of OxyContin, the very drug that caused so much destruction.

Above all, however, they resist the fact that the deal would shut down their ability to pursue not only Purdue but also the Sacklers, who are seen as the driving force behind the company. Although filing for Chapter 11 bankruptcy typically suspends creditors’ lawsuits, there is an exception: The “police powers” of a state to protect its citizens can, on occasion, permit it to keep pressing its case against a company seeking bankruptcy protection.

The states argue that they should therefore be allowed to pursue not only Purdue but also the Sacklers themselves, who are not filing for bankruptcy.

Indeed, this week, a Massachusetts judge turned aside the Sacklers’ efforts to dismiss the state’s case against them, and said it could proceed.

The Purdue deal, the most comprehensive of any settlement so far in thousands of opioid-related cases nationwide, holds great symbolic as well as practical value. As the developer of the opioid OxyContin and a creator of aggressive models of drug marketing, Purdue Pharma has long been blamed for setting off what became the opioid epidemic.

Even as far back as 2007, Purdue and three top executives pleaded guilty in federal court to criminal charges that they misled regulators and doctors about the drug’s risk of addiction and potential to be abused, paying more than $630 million in fines.

Purdue and the Sacklers have long disputed being labeled the progenitors of the crisis. The company notes that even during the worst years of the crisis, between 2013 and 2016, it manufactured scarcely 4 percent of prescription painkillers sold in the United States — and its drugs were not only approved by the Food and Drug Administration, but also monitored by the Drug Enforcement Administration, which itself has been criticized by federal watchdogs for lax procedures.

The states objecting to the deal question whether Purdue even qualifies for bankruptcy protection. They recently noted that Purdue had planned to pay key employees more than $30 million in bonuses. The United States Trustee, a branch of the Justice Department that oversees the administration of a bankruptcy, and the opposing states challenged the propriety of those bonuses, and this week, Purdue offered to delay them.

But the brunt of the objectors’ attack focuses on the Sacklers, who, unlike their company, are not filing for bankruptcy. These states argue that the Sacklers can and should pay far more.