But Rhodes had also suggested previously that the contracts may have been illegal in the first place. With the settlement, that will remain an open question.
Detroit, like many other cities, was sold the swaps as a way to guard against rising interest rates. At the time, in 2005 and 2006, a fixed rate of 6 percent seemed like a good bet. The deals also allowed the city to skirt state borrowing caps and shore up its pension funds. Then, interest rates plunged and the city was stuck paying the higher rate. In 2009, already teetering on the brink of default, the city pledged revenue from its casinos as collateral. Without those funds for city services, Detroit hurtled toward the largest municipal bankruptcy in U.S. history last year.
In rejecting the previous settlements, Rhodes suggested the city could have sued the banks to declare the swaps illegal. That gave Detroit Emergency Manager Kevyn Orr the leverage to push the banks for a better deal.
"Today's ruling is a victory for Detroiters that will help the City reinvest in the services it provides its residents and businesses," Orr said in a statement following the ruling.
The city will pay the banks in monthly installments. In return, the banks will eventually give up their claims to the casino revenue.
Read MoreDetroit bankruptcy judge sets next steps
Perhaps more important, they will support Orr's reorganization plan, which is still deeply unpopular with the city's employee unions and retirees. Support from the banks gives Orr more ammunition to push the plan through—a "cram-down" in bankruptcy parlance—if he can't reach a settlement with the unions.
Appearing on CNBC earlier this week, Orr was already starting to play his hand.
"I implore all parties, specifically our labor parties, please come in and do deals. I do not want to do a cram-down in this case," he said Wednesday on "Squawk on the Street."
Following today's ruling, Orr pushed harder.
"The city's $18 billion debt load is suffocating, and the longer parties wait in hopes of a better deal, the more dire our collective situation becomes," he said in his statement. "The offers on the table are grounded in reality and they won't last forever."
Creditors are scheduled to vote on the restructuring plan by the end of the June. Judge Rhodes has set a trial beginning July 16 on whether to confirm the plan.
Orr is hoping to guide the city out of bankruptcy before his appointment as Emergency Manager expires in September, and the ruling clears a key roadblock. But one restructuring expert says it comes at considerable cost.
"It took up a lot of time, a lot of focus, a lot of emotion," said David Tawil, co-founder of Maglan Capital, a hedge fund that specializes in distressed assets but is not involved in the Detroit case. "This was supposed to be the easiest battle."
Tawil, who is also a bankruptcy attorney, said Judge Rhodes "played dictator" by rejecting the previous settlements. And while Rhodes' hard line ultimately may have saved the city hundreds of millions of dollars, he "undermined the credibility" of the process, Tawil said, potentially making the rest of the bankruptcy case more difficult than it needed to be and costing the city in the long run.
"We are in for a very interesting remainder of the case," Tawil said.