Last week, Puerto Rico took another step in its long, mostly futile attempt to stabilize its economy and budget when it filed for a modified version of municipal bankruptcy. It was the latest chapter in a 20-year struggle that began when an odd coalition of budget hawks, statehood advocates, and critics of corporate giveaways convinced Congress to phase out tax benefits that businesses could garner by locating operations in Puerto Rico. Since then, efforts to make Puerto Rico’s economy more independent and sustainable have come to little, in part because the 1996 reforms were incomplete, leaving in place tax advantages that encouraged the territory to borrow its way to fiscal oblivion, while requiring local employers to adhere to burdensome U.S. labor market requirements. The result is a floundering economy and a mountain of debt. Now bondholders will be asked to take a big haircut, including some lenders who assumed that Puerto Rico would never be able to enter bankruptcy protection. In that regard, Puerto Rico’s filing represents not just a problem for its citizens but also another blow to the protections that municipal-bond investors once believed that they had—but have seen eroded by a series of high-profile bankruptcies in recent years.

It’s a long, twisted story. Puerto Rico has enjoyed some U.S. tax advantages dating all the way back to 1921, when Congress encouraged businesses to set up operations in American territories. Puerto Rico added its own sweeteners after World War II, and the combination of these incentives sparked an economic surge in the 1950s and 1960s as the island developed a manufacturing base, thanks to new investment. Puerto Rico grew at an exceptional annual rate for a Caribbean economy, and even surpassed U.S. GDP growth. But the cost of the incentives to the U.S. Treasury began rocketing in the 1970s as companies found ways to exploit the tax code without necessarily adding new operations or hiring workers in Puerto Rico. Between 1973 and 1995, for instance, the credits cost the U.S. some $70 billion in tax collections, and a study estimated that over the next five years the cost would reach another $20 billion. Meanwhile, job creation stagnated as the mix of companies investing in the island shifted away from labor-intensive firms such as apparel manufacturers to technology-related industries like pharmaceuticals, whose heaviest investments were in research and development.

In the 1990s, as unemployment on the island hovered near 19 percent, Puerto Rico’s tax credits became a target of budget-cutters during debates about eliminating the federal deficit. Opponents of “corporate welfare” argued that the incentives were ineffective and bred economic dependency, while advocates for statehood made the case that, rather than continue its special territorial status, Puerto Rico would be better off as a state, with full participation in the U.S. economy and the programs of the federal government—even if that meant paying U.S. taxes. “It’s no wonder that 2.5 million Puerto Ricans have left the island for the mainland knowing that the political and economic benefits of statehood far outweigh the burdens of federal taxation,” the majority leader of the Puerto Rico senate wrote in a 1995 opinion piece. The next year, President Bill Clinton signed legislation phasing out the tax incentives over 10 years.

Not much has gone right since then. Companies that had enjoyed the island’s generous tax incentives began pulling out, taking jobs with them. From 2004 through 2014, investment as a percentage of the island’s economy declined from about 25 percent to 15 percent. Meanwhile, the statehood movement failed to garner convincing support among residents. That left Puerto Rico without the advantages of being a state but with many of its disadvantages, including adherence to job-killing federal requirements like the minimum wage. In an economy where the median wage is only about a third higher than the minimum wage, the cost of hiring unskilled workers is so expensive that many local employers simply don’t bother—contributing to what a recent study commissioned by the island’s government described as “massive underutilization of labor, foregone output, and waning competitiveness.” As a consequence of this deformed labor market, only about 40 percent of the island’s adult population is employed.

Meantime, Washington has retained the wrong kind of incentives, encouraging the island’s government to load up on debt instead of working to shrink its public spending. The interest on Puerto Rico’s government bonds remained triple-tax free for U.S. residents, which spurred investors to buy Puerto Rico’s debt even while its economy trembled. Some bought the bonds because, until recently, Puerto Rico couldn’t file for bankruptcy—making its debt seem solid. Government also engaged in fiscal gimmicks that otherwise should have set off alarms among creditors, including consistently overestimating how much it could expect to collect in taxes. And the island government and its public entities racked up debt by not contributing meaningfully into its worker pension funds, building up huge liabilities there, too. Puerto Rico’s teachers’ pension fund, for instance, has so little money that contributions by current workers, instead of being invested for their future, are going immediately to pay the pensions of current retirees. The fund could run out of cash as early as next year. Facing this staggering mess, Congress created a new type of bankruptcy under Title III of the Puerto Rico Oversight, Management, and Economic Stability Act of 2016 (PROMESA), which gave a federal oversight board appointed by President Obama the right to negotiate with creditors in a court-supervised setting.

Just about everything about Puerto Rico’s filing is unprecedented. The island owes about seven times more in bonded debt than did Detroit, and its government’s pension funds are in much worse shape. Its recovery plan envisions paying only about $800 million a year on its debt, when it would need four times that much to satisfy its obligations. It has asked some bondholders to take as little as 58 cents on the dollar; bond creditors have balked and sued, which prompted the bankruptcy filing. Creditors worry, as in the case of Detroit and before that of Stockton and Vallejo, that they will be asked to take the biggest fall, with the demands of government workers given precedence over investors—and all under bankruptcy terms that, until last year, didn’t even exist.

It’s accurate to say that Puerto Rico’s government is the ultimate creator of this disaster. But Washington contributed, by offering all the wrong incentives. We shouldn’t be surprised that Puerto Rico took them.