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.