DETROIT (AP) — A federal judge agreed with Detroit on Wednesday and stopped any lawsuits challenging the city's bankruptcy, declaring his courtroom the exclusive venue for legal action in the largest filing by a local government in U.S. history.

The city's $18 billion in long-term debt is the latest chapter for what was once a national industrial powerhouse that helped moved thousands of Americans, including an emerging black population, into the middle class.

The decision by U.S. Bankruptcy Judge Steven Rhodes was a major victory for Detroit, especially after a judge last week said that Gov. Rick Snyder ignored the Michigan Constitution and acted illegally in approving the bankruptcy filing. That ruling and others had threatened to derail the case.

Retirees had sued, claiming the bankruptcy threatened their pensions that are protected by the constitution.

The courtroom was jammed with lawyers representing some of the thousands of 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."

The governor has called Detroit's bankruptcy the only "feasible path" for a city whose population has plummeted to 700,000 from 1.8 million decades ago.

Detroit emergency manager Kevyn Orr, who recommended bankruptcy, sat in the front row. 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 retired workers who are owed benefits — including former officer workers at city hall, police, paramedics, sanitation crews, firefighters and bus drivers — with underfunded obligations of about $3.5 billion for pensions and $5.7 billion for retiree health coverage.

There are three lawsuits in state courts challenging the bankruptcy. They mostly focus on a provision in the Michigan Constitution that says public pensions "shall not be diminished or impaired." Pensions have not been frozen or reduced in the bankruptcy so far, but officials say there are shortfalls in the funds and that payouts could be at risk.

In March, the governor appointed Orr, a bankruptcy expert, as Detroit's emergency manager. Orr had sweeping powers to reshape city finances but recommended bankruptcy after failing to reach any significant deals with creditors, including Wall Street bankers and Detroit pension funds. Many of those creditors, however, accused him of being inflexible and believe bankruptcy always was the plan.