DETROIT - Detroit is formally emerging from bankruptcy, marking the end of the largest municipal case in U.S. history, with officials looking forward to better times and pledging to take advantage of the fresh start.

Michigan Gov. Rick Snyder announced Wednesday that the paperwork was expected to be approved and that the bankruptcy would officially end at 12:01 a.m. Thursday. He thanked the emergency manager, who implemented a two-year budget that eliminates $7 billion in city debt.

Even with the bankruptcy's end, Detroit still must work with a financial review commission on its budgets and spending. The city must also try to reverse decades of population loss.

"We still have enormous challenges delivering services in the city every day," said Mayor Mike Duggan. "But at least now we are no longer a city that's in bankruptcy. So, we're going to start afresh tomorrow, and we're going to do the best we can to deliver the kinds of services the people in this city deserve."

The city's emergency manager, Kevyn Orr, had extraordinary authority over Detroit government for 18 months before giving most of it back to Duggan in September. Snyder hired Orr in March 2013 to take over Detroit's finances. Orr filed the city's bankruptcy petition that July as an effort to overcome decades of population loss, a chronic loss of tax revenue, and piles of debt that couldn't be managed.

In November, federal Judge Steven Rhodes approved Detroit's plan to restructure $7 billion of the city's $12 billion debt load.

It calls for $1.7 billion in savings and revenue over 10 years to improve city services. About $440 million of that will be used to eradicate blight and help demolish more than 40,000 houses standing vacant in Detroit neighborhoods.

About $430 million is promised to improve police and fire services, and response times to 911 calls. Detroit has been criticized for having some of the slowest police response times in the country.

Some retirees also will see their pensions cut by 4.5 percent. Cost of living allowances were reduced for retired police and firefighters.

The impact on retirees would have been more onerous if not for an $800 million promise from foundations, major corporations, and the state to help soften cuts to their pensions while protecting city-owned pieces in the Detroit Institute of Arts from possible sale.