A U.S. judge overseeing the bankruptcy of Linn Energy LLC (NASDAQ: LINE) said on Jan. 24 he is prepared to confirm its restructuring plan with slight tweaks, backing the oil-and-gas producer's goal of shedding $5.5 billion in debt and splitting into two companies.

U.S. Bankruptcy Judge David Jones, at the end of a hearing in Houston, congratulated Linn's legal team and lawyers for working with its key stakeholders, noting the company would have faced a hard time trying to restructure had they not agreed on the plan.

Jones added that he expects a final version of the plan to be filed with him late on Jan. 25.

His signature on an order confirming the plan will put to rest Linn's Chapter 11 bankruptcy, one of the biggest filed by an energy company amid a brutal two-year slump in oil prices.

Linn filed for bankruptcy in May and had been negotiating with stakeholders in recent months on how best to split assets with its Berry Petroleum Co LLC subsidiary.

In 2013, Linn acquired Berry for $4.3 billion, creating one of the largest independent energy producers.

Under Linn's plan, Berry will become an independent company. Linn will shed nearly $4.3 billion of the roughly $6 billion in debt it had when it filed for bankruptcy. Berry will cut nearly $1.2 billion of its $1.7 billion in prepetition debt.

The two companies also settled claims against each other and have lined up financing to emerge from bankruptcy and remain in business.

Linn has arranged a $530 million rights offering its noteholders will guarantee.

Berry has a rights offering worth $300 million for holders of unsecured notes.

The offerings will allow the noteholders to increase equity stakes in the companies, which will gain new capital.

Linn and Berry will emerge from bankruptcy with oil prices having roughly doubled from year-ago levels of around $26 per barrel (bbl), though prices remain well below a peak of more than $100/bbl in 2014.