The city of Detroit won judicial approval to move forward with its bankruptcy filing Tuesday despite objections from city workers fearful of losing their pensions and other creditors.

Saddled with more than $18 billion in debt and a tax base depleted by decades of population loss and urban blight, the birthplace of the US auto industry has been so strapped for cash it can't even keep the street lights on.

It filed for bankruptcy protection in July, the largest US city ever to do so.

After lengthy initial hearings and weeks of deliberation, Judge Steven Rhodes ruled Detroit is eligible to restructure its debt and liabilities under Chapter 9 of the US bankruptcy code that applies to municipalities.

The decision was immediately appealed by the city's largest public sector unions on behalf of retirees.

It was hailed by Michigan Governor Rick Snyder as the only "viable" way for Detroit to "stay on the path toward a brighter future."

“There will be other difficult decisions as we work through this process," Snyder said in a statement.

"But Michigan and Detroit are resilient and are the comeback stories in the country. Working together we can and will make sure that reinvention happens.”

In an unusual move, Rhodes explained his decision in a court hearing prior to releasing his complex 140-page opinion.

Bankruptcy was a "foregone conclusion" and should have happened years ago, Rhodes told the packed court.

"The city no longer has the resources to… provide its citizens basic services," the Detroit News quoted Rhodes as saying.

"To reverse this decline and attract new residents and revitalize and reinvigorate, Detroit needs help."

Thousands of retired city workers are fearful they will be pushed into poverty if Detroit is able to slash their pension benefits, which are supposed to be protected by the state constitution.

Rhodes warned that federal bankruptcy law allows for the pensions to be cut, adding "the court emphasizes that it will not lightly or causally exercise federal bankruptcy law to impair pensions."

The city-owned Detroit Institute of Arts is also at risk of closing its doors if Rhodes allows even part of its world-class collection to be sold to pay off Detroit's debts.

Rhodes indicated that may not happen, arguing that selling assets would be a one-time fix that wouldn't address Detroit's deeper problems.

“When the expenses of an enterprise exceed its revenue, a one-time infusion of cash, whether from an asset sale or borrowing, only delays inevitable financial failure unless the enterprise reduces expenses or enhances income,” Rhodes said, according to the Detroit News.

The bankruptcy is expected to make it harder for municipalities in Michigan and other US states to borrow money, by undermining confidence in what used to be among the most trusted bonds available.

The situation in Detroit is being closely monitored by government workers across the country who are fearful that they too may see their retirement benefits slashed by cash-strapped states and cities.

Once a bustling beacon of industrial might, the Motor City is now a poster child for urban decay, its landscape littered with abandoned skyscrapers, factories and homes.

Detroit has seen its population shrink by more than half, from 1.8 million people in 1950 to 700,000 today.

Racial tensions sparked by the civil rights movement and devastating 1967 riots exacerbated white and middle-class flight to the suburbs. Businesses followed suit, further shrinking the tax base.

With less revenue, Detroit had to cut back on services, prompting even more people to leave and eventually sending the city into an economic tailspin.

A whopping 40 percent of street lights don't work and the average police response time is 58 minutes.

Home to the "Big Three" US carmakers -- Ford, Chrysler and General Motors -- the Motor City also saw its main employers go through rounds of mass layoffs as auto factories were automated and jobs outsourced.