A federal judge Wednesday swept aside lawsuits challenging Detroit’s bankruptcy, settling the first major dispute in the scramble to get a leg up just days after the largest filing by a local government in U.S. history.

After two hours of arguments, U.S. Bankruptcy Judge Steven Rhodes made clear he’s in charge. He granted Detroit’s request to put a permanent freeze on three lawsuits filed in Ingham County, including another judge’s extraordinary decision that Gov. Rick Snyder trampled the Michigan Constitution and acted illegally in approving the Chapter 9 filing.

That ruling and others had threatened to derail the bankruptcy.

Questions about Detroit’s eligibility to turn itself around through bankruptcy “are within this court’s exclusive jurisdiction,” Rhodes said.

He said nothing in federal law or the U.S. Constitution gives a state court a dual role. It was a victory for Detroit, which had warned that it would be “irreparably harmed” if it had to deal with lawsuits in state courts while trying to restructure $18 billion in debt with thousands of creditors.

“Widespread litigation … can only confuse the parties, confuse the case and create serious barriers,” attorney Heather Lennox told the judge.

Creditors “will have their day in court” — bankruptcy court, she said.

The courtroom was jammed with lawyers representing creditors as well as rank-and-file city employees and retirees eager to know the outcome. Some wore T-shirts that said, “Detroit vs. Everybody.”

Detroit emergency manager Kevyn Orr, who recommended bankruptcy, sat in the front row for part of the hearing. Outside the courthouse, protesters held a banner with a message for Wall Street: “Cancel Detroit’s debt. The banks owe us.”

Detroit has about 21,000 retirees — police, firefighters, City Hall clerks, trash haulers, bus drivers — who are owed money and fear their income is at risk in a bankruptcy. Orr has said the city has underfunded obligations of about $3.5 billion for pensions and $5.7 billion for retiree health coverage.

The Michigan Constitution states that public pensions “shall not be diminished or impaired.” An Ingham County judge cited that provision last week when she ordered Snyder and other officials to take no further action in the Detroit bankruptcy.

Sharon Levine, an attorney for a union that represents city workers, urged the bankruptcy judge to let those lawsuits run their course. She said there’s no federal insurance for public pensions once they’re broken, unlike pensions at private employers.

“Our members who participate at most are at or below $19,000 a year. There is no safety net,” Levine said.

Although Rhodes ruled in favor of Detroit, he said opponents will have opportunities to make the same arguments in his court in the future. He has many critical issues ahead, including whether Detroit really is broke and entitled to greatly reduce or wipe out debts. The process could last a year or more.

Michael Nicholson, general counsel for the United Auto Workers, was disappointed with Rhodes’ decision.

“State courts have the power to decide what the state constitution means,” Nicholson said outside court. “In our view, retirees’ rights are a matter of Michigan constitutional rights.”

Snyder signed off on Detroit’s bankruptcy on July 18, calling it the only practical choice for a city whose population has plummeted to 700,000 from 1.8 million decades ago. Detroit’s long-term debt has become an urban millstone.