Garuda Indonesia’s proposal for restructuring its more than U$9 billion debt won the approval on Friday from the vast majority of the airline’s creditors, court officials said, staving off the risk of bankruptcy at the embattled flag carrier.

More than 95% of creditors who attended Friday’s vote on the plan at a Jakarta court accepted Garuda’s proposal, enough to reach agreement for all who submitted claims, a team of court-appointed administrators said.

About 142 trillion rupiah ($9.58 billion) in claims against Garuda would be settled by the agreement, which is set to be ratified by a judge on Monday.

The plan was for aircraft manufacturers, lessors, maintenance vendors, and Islamic bond investors, which hold the biggest chunk of liabilities, to take a large debt “haircut”, or write-down, and exchange the remaining amount with $825 million of 9-year bonds and $330 million equity.

A Garuda financial adviser said this scheme would restructure about $5.5 billion to $6 billion of liabilities, while the rest, including loans to banks and state firms, like fuel provider Pertamina and airport operators, would be extended without a cut.

“We are committed to fulfill all our responsibilities that we have conveyed in the proposal,” a teary-eyed Garuda chief executive, Irfan Setiaputra, told creditors after thanking them for their support.

Those who submitted claims to the court include investors of Garuda’s $500 million Islamic bonds, Britain’s aircraft engine maker Rolls-Royce RR.L and European planemaker Airbus AIR.PA.

Garuda’s CEO told creditors ahead of the vote that the firm’s bond and equity offers had taken into account potential claims by Boeing BA.N related to Garuda’s plan to terminate its order for 49 of Boeing’s 737 MAX 8 planes, even though the U.S. planemaker had not participated in the court process.

Boeing will have 30 days from Monday to put forward its claim, estimated at $822 million. If it fails to do so, the offer would be deducted from the total bonds and shares and the remainder would be prorated to other creditors, Setiaputra said.

Rolls-Royce, Airbus and Boeing declined to comment.

Garuda’s financial woes were exposed when the pandemic decimated global air travel.

Other Southeast Asian carriers including Malaysia Airlines, Thai AirwaysTHAI.BK, Philippine Airlines PHL.UL and AirAsia X AIRX.KL have also gone through corporate restructuring overseen by courts.

Garuda is targeting profitability within 2-3 years by focusing on its most profitable routes and cutting back on its loss-making international routes.

It plans to launch rights issues to strengthen its capital after securing the court-overseen agreement with creditors.