WHITE PLAINS, N.Y. — Purdue Pharma LP is based in Connecticut and incorporated in Delaware. Yet the company at the center of the opioid crisis filed for bankruptcy here, in a court where its case would be assigned to the only judge who works there.

Bankruptcy Judge Robert Drain, on the bench since 2002, has long experience with complicated bankruptcy cases. He has overseen the bankruptcy of Chicago-based Sears, as well as the large grocery store chain Great Atlantic & Pacific Tea, known as A&P. And in a 2014 case, Drain also issued a ruling staying lawsuits against third parties that hadn’t filed bankruptcy.

On Friday, Drain will hear arguments over whether to take the unusual step of halting action in about 25 lawsuits brought by various states against Purdue and members of the Sackler family, which owns the company. Without that protection, the Sacklers may back out of a tentative settlement valued at $10 billion to $12 billion with the rest of the states and more than 2,500 cities and counties that have sued Purdue in a mammoth federal court case. As part of that deal, the Sacklers would relinquish control of their firm.

Losing the protection against other lawsuits “risks toppling” the deal, Purdue Pharma has argued.

Large corporations have considerable flexibility in choosing where to file bankruptcy. Purdue’s choice didn’t surprise bankruptcy experts.

“Of course Purdue strategically picked White Plains over all other courts. That’s like asking whether a chess master has a strategy or just makes moves randomly,” said Lynn M. LoPucki, a professor at the UCLA School of Law.

“It’s similar to gerrymandering. In the same way that politicians are accused of choosing their voters, corporate debtors are accused of choosing their judges,” said Jonathan Lipson, a professor at Temple University’s Beasley School of Law.

Sens. Elizabeth Warren (D-Mass.) and John Cornyn (R-Tex.) introduced legislation last year to tighten the rules around where companies can file for bankruptcy, but the bill was not brought up for a vote.

States opposed to the settlement are fighting the bid to halt their lawsuits, contending that the Sacklers should put more of their own personal money into the deal and will walk away with billions they took out of the company. They contend that the Sacklers’ proposed $3 billion contribution to the settlement is insufficient, noting that Forbes has estimated the family’s net worth at $13.5 billion, which the magazine said makes them one of the wealthiest families in the United States.

The states also have cited deposition testimony that the Sackler family took $12 billion to $13 billion in cash out of Purdue Pharma.

Staff for two of the most outspoken attorneys general, Maura Healey of Massachusetts and William Tong of Connecticut, declined to discuss whether they believe Purdue filed in White Plains because they wanted Drain to hear the case.

The federal plaintiffs, whose trial against six other drug companies is scheduled to begin in coming weeks in a federal court in Ohio, did not respond to requests for comment.

A spokesman for the branch of the Sackler family that includes former president and board chairman Richard Sackler did not provide comment for this story. A Purdue representative also did not respond to requests for comment.

Drain appeared sympathetic to Purdue’s arguments at a hearing Thursday that lawsuits against the company should be stayed. Purdue and the Sacklers have valuable assets, but they are minuscule compared to the cost of the opioid crisis, he said. The wave of addiction fueled by opioids over the past 20 years has taken more than 400,000 lives.

“The money therefore should be put to the best use,” Drain said. “It is obvious that dealing with individual claims is not necessarily the best use” of the company’s assets.

Drain tackled the issue of staying lawsuits in the 2014 bankruptcy of silicone maker Momentive, which at the time was owned by Apollo Global Management, a huge private equity firm. In that case, Drain found that giving third parties such releases was an important part of Momentive’s restructuring plan. Without it, there was a “reasonable risk” that some lenders might not support the company’s restructuring plan.

The ruling generally followed the precedent set in other courts, but other Manhattan bankruptcy judges have been more skeptical of granting such releases in recent cases, said Adam J. Levitin, a Georgetown Law School professor who studies bankruptcy.

There are some significant differences between Purdue’s bankruptcy and the Momentive case, but Drain’s 2014 ruling on whether to release third parties from litigation still turned on similar issues, Lipson said.

“The releases were in exchange for significant contributions” to the bankruptcy reorganization, he said. The court could “only release the Sacklers if the circumstances are truly unusual and critical to the plan.”

State attorneys general who object to aspects of Purdue Pharma’s settlement and bankruptcy have little power to ask for a change of venue, Lipson said. The bankruptcy rules on venue are lax, he said.

“The company wants to minimize its litigation exposure and believes that Judge Drain will give them a fair hearing on this issue, which I think is true. He is an evenhanded judge,” Lipson said.

More than a dozen attorneys packed the small courtroom in this New York City suburb Thursday to squabble over the drugmaker’s assets. Outside the courthouse, a small group of protesters lay on the ground, covered in money.

Drain is aware of the high stakes involved in the case.

“This is not a normal case. It’s a very public case,” he said before authorizing the company to move forward with some employee compensation programs during the bankruptcy. “Public perception here is more important than in most cases.”