The UK government has set aside nearly £1.7bn to allow energy firm Bulb to continue supplying energy to customers, according to the BBC.
The firm was put into special administration on Wednesday, which will let it keep trading for the moment.
Bulb will be run by administrator Teneo until a buyer can be found or until its customers have moved.
The government loan will mean the administration is managed in a way that the lights stay on for Bulb’s 1.7 million customers.
Teneo estimates it will cost around £2.1bn to keep Bulb trading until the end of April next year.
Business Secretary Kwasi Kwarteng can provide more money for the company if needed.
Without the cash, Bulb would not have been able to keep going past the middle of December, court documents show.
Due to its size, Bulb will be run as normal for the time being, rather than its customers being immediately transferred to other suppliers, as has happened with other failing energy providers.
By April, the cap on energy prices may have increased significantly, which would mean higher revenues for the business.
The company is three times larger than any other energy supplier that has failed in recent years.
Normally regulator Ofgem lets a firm fail and moves its customers to a new supplier.
At the High Court in London, Justice Adam Johnson said that if left unresolved uncertainty over Bulb would be “bound to have an effect on customers, employees and suppliers”.
He said that the administration was designed “to keep the energy supply company going, with a view to it being rescued if that is possible”.
He added that an alternative would be to appoint a supplier of last resort, adding: “That is thought to be impractical here, given the size and importance of Bulb as a supplier”.
The judge said that the £1.7bn would be “of existential importance to Bulb”.