After decades of decline, the city of Detroit, once the cradle of the U.S. auto industry and middle-class urban prosperity, filed for bankruptcy on Thursday. The move not only begins the largest municipal-bankruptcy proceeding in U.S. history in terms of debt and population, but also culminates the stunning, slow-motion fall of an iconic American metropolis.

“The fiscal realities confronting Detroit have been ignored for too long,” Michigan Governor Rick Snyder said in a statement. “This is a difficult step, but the only viable option to address a problem that has been six decades in the making.”

The filing may be the Motor City’s best hope to mend its broken finances. But first it faces myriad legal hurdles as it tries to work out a resolution with its creditors. Four months after Snyder appointed emergency manager Kevin Orr, a bankruptcy lawyer, to take over Detroit’s fiscal affairs, the city is moving into a period of extreme uncertainty in which a federal court will decide its liability for billions of dollars in broken promises.

When he arrived on the job in late March, Orr took control of a city with an estimated $17 billion in long-term debts and a $327 million annual budget deficit. On July 12, the city announced it would stop making payments on about $2.5 billion in unsecured loans and asked some of its creditors — bond issuers, unions and pensioners — to forfeit as much as 90% of what the city owed them in order to avoid bankruptcy.

A primary reason anyone files for bankruptcy is to avoid lawsuits from creditors unwilling to take a large haircut. Detroit is no different. “It’s a very powerful protective remedy for people who owe money,” says John Pottow, a professor of bankruptcy and commercial law at the University of Michigan Law School. But the first proceedings will likely be a challenge from creditors whether the city is eligible to file.

The majority of bankruptcies in the U.S. fall under Chapter 11 reorganization or Chapter 7 liquidation, which apply to individuals and businesses. Chapter 9 bankruptcies, like the one Detroit filed for, allow for the reorganization of municipalities and differ significantly from other bankruptcies. “A Chapter 9 bankruptcy is still a bankruptcy,” Pottow says. “Although it doesn’t have all the rules of Chapter 11.” After filing with a bankruptcy court, a debtor usually files a plan of reorganization, which the court must approve. The debtor then reduces its debts by paying back a portion of what it owes.

That’s where things get complicated for municipalities. Under Chapter 11, if a company can’t restructure, the proceeding moves to Chapter 7 — the company is liquidated, and the sale of the company’s assets goes to pay off creditors. But under Chapter 9, a court can’t order liquidation. “Such a liquidation or dissolution would undoubtedly violate the Tenth Amendment to the Constitution and the reservation to the states of sovereignty over their internal affairs,” according to an explanation by the U.S. federal courts.

While a court can’t order a city to sell its assets, the city can sell off the ones it chooses. But many of those assets, like police cars or school buses, are vital to the functions of a city. Others, as Orr found out in May, when he reportedly contemplated selling the Detroit Institute of Art’s collection, are considered sacrosanct by the public.

Another challenge of a Chapter 9 bankruptcy is that it is difficult to get out of contracts negotiated under a collective-bargaining agreement. Detroit will have to prove to the court that dramatically renegotiating is necessary for the survival of the city. According to figures released by Orr’s office, more than 40% of Detroit’s revenues were spent on so-called required payments such as pension checks, bond liabilities, health care benefits and other dues, which are estimated to grow to 65% of the city’s spending in the next four years.

Detroit’s filing may be historic, but it is not unprecedented. Dozens of cities and counties have filed for bankruptcy over the years, including several in the wake of the 2008 financial meltdown. In that year, Vallejo, Calif., filed for Chapter 9 because it couldn’t pay its pension obligations. Jefferson County, Ala., which includes Birmingham, filed in November 2011, after becoming mired in Wall Street’s problems. The largest city to file for bankruptcy before Detroit was Stockton, Calif., in June 2012. The city of 300,000 faced nearly $148 million in unfunded pension costs and more than $230 million in other debts.

But the Motor City’s $17 billion hole dwarfs those cases. “Certainly Detroit is something on the scale we’ve never seen before, both in terms of the quantity of the debt and also the concession they’re asking the creditors to take,” Pottow says. Orr’s reorganization plan will likely ask creditors to accept just 10% of what they are owed. Bankruptcy experts say there is no way to predict the outcome, but a large write-down is likely. In the Vallejo bankruptcy, creditors got between 5¢ and 20¢ on the dollar; in Jefferson County, some creditors got close to a third of what they were owed.

While bankruptcy is not a preferred way to restructure debts, it is often necessary for a fresh start. “The way Detroit is today can’t continue,” says Douglas Bernstein, a bankruptcy lawyer in Bloomfield Hills, Mich. “At some point you’ve got to realize you’ve hit rock bottom, you wipe out the debt that you can’t afford and change the processes that got you in this situation to begin with. You clean up your balance sheets and you should only get stronger as time goes on.”

But before Detroit can reorganize and get stronger, it faces months, and perhaps years of legal proceedings. More than 18 months after starting bankruptcy procedures, Jefferson County filed to end its bankruptcy later this year, proposing to write off a quarter of its debts. Under the plan, JPMorgan, which issued the county’s sewer warrants, will collect about 31% of what it’s owed.

Detroit’s misfortune probably means its creditors won’t get that much. “For legal scholars and interested parties it’s a fascinating process,” Bernstein says. “But the people here are going to feel some more pain.”