A plan to restructure about $9 billion of Puerto Rico’s debt, hailed as a model for the rest of the island’s debt-laden government, moved toward the desk of Gov. Alejandro García Padilla to be signed into law on Tuesday, after winning approval by Puerto Rico’s House of Representatives.

The Puerto Rico Senate, which approved a similar bill last week, was still working on Tuesday to iron out differences between the two bills. The restructuring deal was set to expire at midnight on Tuesday if not signed by the governor, but a person with knowledge of the proceedings who spoke on the condition of anonymity, said the lawmakers were within striking distance of agreement and the creditors were not inclined to enforce the deadline.

The $9 billion in debt is mostly in the form of municipal bonds issued by the Puerto Rico Electric Power Authority, or Prepa. When the utility failed to make a debt payment in 2014, its bondholders decided to try to restructure the debt consensually instead of going to court. Last year, a majority agreed to a debt exchange, in which bondholders would get new bonds worth 85 percent of the face value of their old bonds. The new bonds would also have a slower payment schedule and lower interest rates.

The plan appeared to be in trouble earlier this year when lawmakers seemed to have second thoughts and delayed approval. Unionized electrical workers protested in front of the legislature this week while lawmakers debated and voted.