In the largest bankruptcy of a U.S. state or territory, Puerto Rico Gov. Ricardo Rossello requested court protection for his U.S. commonwealth to resolve a large number of lawsuits from creditors.

The Puerto Rico Financial Oversight and Management Board, installed by Congress in 2016, invoked a law that placed a federal judge in charge of the restructuring process. The legal case is theoretically not a bankruptcy filing under the federal code that governs municipal cases, but it is similar. Puerto Rico’s debt crisis will trigger a brutal legal battle in which creditors, pensioners and its citizens have conflicting claims.

Puerto Rico and its agencies owe more than $123 billion to creditors. To put this in perspective, the city of Detroit — previously the largest government jurisdiction bankruptcy — owed about $18 billion.

How will bondholders be treated?

The payout depends on the status of their debt and the strength of Puerto Rico’s economy. If bondholders hold secured bonds, their outcome will be significantly better than those who hold junior debt. Unsecured bondholders could be crammed down. In layman’s terms, this means a major loss.

Moody’s Investor Service vice president Ted Hampton said Wednesday that the bankruptcy filing is “a positive step for bondholders overall because it will bring about an orderly process. Otherwise, creditors face a chaotic period involving proliferating lawsuits.”

Why did people find lending to Puerto Rico appealing? Puerto Rico’s bonds were exempt from federal, state and local taxes. Their high after-tax nominal yield made them look like good investments.

What will happen to Puerto Rico pensioners?

They will receive less than they were promised. Municipal market analyst Matt Fabian wrote in a research note, however, that pensioners might fare better than investors because they are more sympathetic figures politically than Wall Street creditors.

What has been the economic impact of Puerto Rico’s declining fiscal health?

Over the last decade, Puerto Rico’s economy has deteriorated significantly, suffering:

• A 25 percent decline in its gross national product.

• 60 percent unemployment. Jobs have declined 20 percent since 2007.

• 50 percent enrollment of its population in Medicaid.

• A 10 percent decline in population to less than 3.5 million, reducing the commonwealth’s tax base.

• Government cutbacks that have closed everything from schools to social-service providers to its largest public hospital.

What caused Puerto Rico’s decline?

When Congress ended tax credits to companies that established factories in Puerto Rico in 2006, its economy fell into recession.

Instead of taking corrective steps necessary to deal with the commonwealth’s declining revenues, its government spent heavily and borrowed to finance budget shortfalls. The government also promised pensions beyond its fiscal capability to pay.

And in 2015, Puerto Rico’s then governor declared its debts unpayable. This meant that the island lost access to the credit markets.

There are many lessons to be learned by from Puerto Rico’s situation.

First of all, despite written guarantees, bond holders are finding that Washington and San Juan both have changed the rules to diminish their rights. Sanctity of contract, a major underpinning of a capitalistic economic system, has been undermined.

Secondly, Puerto Rico does not have the support of the International Monetary Fund, which has bailed out sovereign nations.

Thirdly, the economic damage to Puerto Rico from the emigration of many of its professionals to the United States will last decades.

Fourthly, the unwillingness of politicians to take remedial steps to confront the financial deterioration exacerbated the problem. They forgot the lesson “a stitch in time saves nine.”

Lastly, the legal struggles of Puerto Rico have implications for other heavily indebted state and local governments such as Illinois and Philadelphia. According to the State Commission on Government Forecasting and Accountability, the unfunded pension liability of Illinois approached $130 billion in 2016. The city of Philadelphia had an unfunded liability of $5.3 billion. Ouch!