The city of Detroit has reached a deal with two banks to help pay off a disastrous pension debt deal blamed for plunging the city into bankruptcy.

The settlement, filed yesterday in bankruptcy court, is the city's third try at ending controversial interest rate swaps.

The deal must still be approved by U.S. Bankruptcy Judge Steven Rhodes, who rejected the two earlier and costlier settlements. Under this agreement, the city would pay UBS and Bank of America Merrill Lynch $85 million to settle the $293 million debt.

The Detroit News reports the deal would free up $15 million in monthly casino tax revenue that the banks hold a lien over until they’re paid each month.

The settlement is a bid to end the deal engineered during ex-Mayor Kwame Kilpatrick’s tenure which is costing the city nearly $50 million a year, or about five percent of its annual budget.