After three years of negotiations, Puerto Rico’s federal overseers are at last finishing up a plan to complete the restructuring of the island’s roughly $124 billion in debt. To resolve the biggest government financial collapse in United States history, they have had to untangle the island’s thorny finances, negotiate with creditors and figure out how to do it without endangering the livelihoods of retirees who rely solely on their pensions.

That may have been the easy part.

Some of the island’s creditors — including the hedge fund Aurelius Capital Management, which held up Argentina’s debt settlement for years for a better deal — will almost certainly challenge the plan on the ground that it violates the territory’s 1952 Constitution.

At the center of it all are two intertwined issues. The oversight board wants to cut back the amount paid to some of those who hold the territory’s debt while also giving an unexpectedly good deal to more than 300,000 workers and retirees, some of whom do not even have Social Security. The good deal for the pension holders means a worse one for the holders of Puerto Rico’s debt.

“You can make social and political decisions,” said James E. Spiotto, a longtime municipal bankruptcy lawyer who is not involved in Puerto Rico’s legal proceedings. “But it’s best to have them wrapped up in a settlement that everybody agrees to.”