The territory was able to improve the deal for bondholders because of a recent economic windfall. Though the island’s economy remains fragile — it was battered by a major hurricane that caused a monthslong power failure in 2017 and recently by a series of earthquakes — the government has built up a large supply of cash.

That’s mainly because it has been sitting on the money it would have been paying to bondholders had it not defaulted in 2016. But the island has also benefited from a flurry of post-disaster rebuilding, which has led to more business-income tax revenue than expected.

The oversight board, which was set up in 2016, has also engaged in strong-arm negotiations, including challenging the supremacy of general-obligation creditors, who are accustomed to being paid first.

It also said general-obligation bonds brought to market starting in 2012 had exceeded the territory’s debt limit and would have to be voided. That would have meant the investors holding them — mostly hedge funds and other financial institutions — would have to pay back any interest or principal they had received.

While angry bondholders threatened lawsuits, the board used that threat as leverage. It offered holders of pre-2012 bonds 64 cents on the dollar, and those holding later vintages either 45 cents or 35 cents on the dollar.

Holders of the later bonds were free to pursue their lawsuits, and the oversight board would set up a litigation trust to pay them up to 64 cents on the dollar if they won. But if they lost — if the court confirmed that their bonds were invalid — those bondholders would get nothing.

Those bondholders said the board’s offer amounted to illegal discrimination and vowed to sue. Among them were Aurelius Capital Management, which has pursued aggressive litigation strategies in other debt meltdowns, most famously in Argentina, where the lawsuits took years to resolve.