The city of Detroit filed for Chapter 9 bankruptcy protection yesterday with some $18 billion in debt, making it the largest municipal bankruptcy in the United States.

There will inevitably be calls for the federal government to bail out Detroit. Washington should set a firm precedent now that it will not bail out reckless city, county, or state governments. Detroit must solve its own problems, and sadly, bankruptcy is the last mechanism to force city leaders to do that.

Detroit’s bankruptcy filing should come as no shock; the city’s decline has been decades in the making. Detroit’s financial and economic decline took root in the manufacturing decline in America. But the decades of continual decline that have followed, in which the city lost more than 60 percent of its population, stem from the city’s precisely wrong response to the manufacturing decline.

Rather than implement sound financial and economic policies and promote a vibrant private sector to help rejuvenate the city, Detroit’s policymakers attempted to shift resources from the private sector to the public sector, raised taxes, and increased regulations—all while fostering an ever-expanding city government. Sadly, city leaders took their cues from the auto industry by growing government through generous promised but unaffordable future pension and health care benefits. In fact the biggest share of Detroit’s debt comes from these unaffordable promises: $6 billion in health and other post-employment benefits for retirees and $3 billion in pensions.

For decades, Detroit sustained itself through the usual suspects of bad fiscal management: unaffordable borrowing, state grant schemes, raising taxes, and deferring public pension contributions rather than cutting city spending. But Detroit’s tragic downward cycle has reached its end. With all tax rates close to their statutory max and dismal public services that discourage individuals and businesses from remaining in or coming to Detroit, the city simply cannot continue to fund its operations and service its debt.

It has been rumored that Detroit’s creditors and pensioners may receive mere pennies on the dollar to what they are owed. Certainly there will be cries of “unfairness.” But a federal bailout—whereby taxpayers in fiscally responsible cities and states have to pay for the services and promises made by city and state governments that waived such discipline for decades—would be far more unfair.

What’s more, a federal bailout of Detroit would set a dangerous precedent for future state and local bailouts. Detroit is not the only city facing serious financial trouble; there are many more municipalities for whom bankruptcy seems the inevitable outcome. And if bailouts really were a panacea, then state bailouts from the 2009 stimulus legislation should have put every state on firm fiscal footing.

All bailouts do is punish those state and local governments that are good stewards and enable those that are not to continue profligate fiscal policy and poor management. Bankruptcy, and the threat it carries, forces government leaders to confront and solve their own problems.

Washington should also learn its own lessons from Detroit. Total national debt is over $17 trillion, bigger than the entire U.S. economy. Beyond huge growth in nearly all federal programs, future spending will be driven to the breaking point by our own federal retiree spending programs—Medicare, Medicaid, and Social Security. Rather than discouraging other troubled state and local governments from getting their fiscal houses in order through bailouts or other support, federal lawmakers should fix their own fiscal problems.