(Reuters) - A U.S. bankruptcy judge approved on Tuesday PG&E Corp’s $13.5 billion settlement with victims of Californian wildfires, and the company’s stock rallied as the utility gained momentum to emerge from bankruptcy in June as planned.

“I don’t think we’ve heard a single person say it’s a bad settlement,” U.S. Bankruptcy Judge Dennis Montali said during a six-hour hearing in San Francisco.

The settlement provides cash and PG&E stock to a trust for the benefit of individual wildfire victims.

Montali also approved an $11 billion agreement with insurance companies, locking up the last and two most significant creditor groups.

Adding momentum to PG&E’s plan, a lawyer for Governor Gavin Newsom told Montali the governor viewed the wildfire settlement as fair. “We don’t want to stand in the way of that,” Nancy Mitchell said.

On Friday, Newsom rejected the PG&E reorganization plan and said the company would need a new board of directors and stronger finances to comply with a recently enacted wildfire law, known as AB 1054.

Mitchell said the necessary changes to the plan could be negotiated, although she called the governor’s demands a “high bar.”

Newsom has accused the company of putting profit ahead of maintenance of its power lines and of poorly managing the widespread blackouts PG&E used to avoid sparking wildfires during high winds.

Opponents of the $13.5 billion agreement, led by bondholders, wanted Montali to strike a provision that obligates lawyers for victims to support PG&E’s plan to exit bankruptcy.

Bondholders want wildfire victims to have the option to support their competing bankruptcy exit plan, which they argued could be a fallback if PG&E failed to satisfy the governor.

The bondholder plan would wipe out the company’s stock value and while the bondholders have argued their plan was better for wildfire victims, a lawyer for the victims said it would face a tougher time getting confirmed by the court.

PG&E’s stock jumped about 13% to $10.91 a share and regained most the ground lost after Newsom’s rejection of the company’s bankruptcy plan.

The company’s plan needs approval from Newsom and Montali by June 30 to participate in the wildfire fund, which reduces liability for investor-owned utilities but requires them to spend billions of dollars upgrading equipment.

PG&E filed for Chapter 11 protection from creditors in January facing 70,000 legal claims from at least 22 fires from 2017 and 2018, with victims seeking $36 billion.