U.S. Bankruptcy Court Judge Steven Rhodes ruled Tuesday that Detroit was eligible for Chapter 9 bankruptcy protection, a decision that comes after four months of legal fighting between the state of Michigan and the unions representing city employees.

"The court finds that Detroit was and is insolvent. The court finds that the city was generally not paying its debts as they became due," Rhodes said, according to the Detroit Free Press.

The decision means that the city can begin to restructure its estimated $18 billion in debt, including trimming the city workers' pension programs. Unions have fought against this, arguing that state law prevents such adjustments.

The unions had argued in court that Michigan's Republican Gov. Rick Snyder had improperly forced the city into bankruptcy in July — the decision was made by an emergency manager appointed by the governor — and that the city was not truly insolvent. Rhodes rejected this, finding that "this once-proud city cannot pay its debts."

Unions vowed to appeal the ruling. “We think this is a huge loss for the people of Detroit,” AFSCME lawyer Sharon Levine told the Detroit News.