Scandinavian airline SAS AB won bankruptcy court approval on a debt restructuring funded by a $1.2 billion investment anchored by Air France-KLM and private equity firm Castlelake LP.

Judge Michael Wiles said Tuesday in a Manhattan hearing that he’d approve SAS’s restructuring plan pending final technical changes to his court order. The decision clears SAS’s path to exit Chapter 11 after the airline sought court protection in July 2022 in the wake of a substantial revenue drop caused by the Covid-19 pandemic, pilot strikes and fierce competition from lower cost carriers.

SAS Chief Executive Officer Anko Van der Werff thanked Judge Wiles for approving the restructuring.

“It’s been a complicated case,” Van der Werff said in court. “I’m really happy where we got to.”

Enactment of the restructuring is contingent upon approval from various regulatory authorities and completion of a related Swedish restructuring proceeding, the company said in February. SAS has said it will emerge from bankruptcy with roughly $1.1 billion in unrestricted cash and $2.2 billion in net debt, compared to $4.2 billion in net debt at the time it filed Chapter 11.

SAS has said it anticipates emerging from Chapter 11 in the first half of 2024.

The airline selected the Air France-KLM and Castlelake-led investment in October after spending months searching for new capital. The investment consortium also includes Lind Invest ApS and the Danish state. The investment is comprised of $475 million in new, unlisted equity and $725 million in secured convertible debt, according to court documents.

SAS’s plan provides roughly $325 million to unsecured creditors, in the form of cash and roughly 13.6% of the reorganized airline’s equity. A lawyer representing SAS creditors said during Tuesday’s hearing that the airline is better positioned to compete in the market now than it was when it filed Chapter 11 in 2022.

The case is SAS AB, 22-10925, U.S. Bankruptcy Court for the Southern District of New York (Manhattan).