(Bloomberg) -- Germany hammered out a rescue package for Uniper SE to prevent the collapse of a linchpin in the country’s energy network in the wake of Russia’s moves to slash gas supplies.

The government will get about 30% in Uniper, a holding big enough to give it veto rights on important strategic decisions, Uniper said in a statement on Friday. Fortum Oyj, Uniper’s main shareholder, will retain a majority.

The package includes an expanded credit line of 9 billion euros ($9.1 billion) from state-owned lender KfW and mandatory convertible securities of 7.7 billion. The total package is worth more than four times the company’s current market value. 

Uniper became the first major corporate casualty of Europe’s unfolding gas crisis when it asked Chancellor Olaf Scholz’s administration for a bailout earlier this month. Germany’s biggest buyer of Russian gas was pushed to the brink as President Vladimir Putin squeezed supplies in retaliation over European sanctions against Russia’s invasion of Ukraine.

The Dusseldorf-based company’s shares climbed as much as 11% after the deal was announced. The stock has still tumbled more than 70% this year, valuing the company at about 4 billion euros. Main owner Fortum gained as much as 8.9 percent before trading was halted.

Fortum agreed to see its stake diluted to 56% from about 80% as part of the bailout plan. The Finland-based company will now have the option to convert its existing 4 billion-euro loan made to Uniper against a portion of maximum 70% of the mandatory convertible instruments subscribed by the German state, ensuring its ability to retain its position as the majority shareholder, it said in a statement.

Uniper -- setup in 2016 from the former fossil-fuel assets of E.ON SE -- emerged as the weakest link in the energy system that powers Europe’s largest economy. Its extensive contracts with state-owned Gazprom PJSC made the German energy company vulnerable to supply cuts and forced it to cover shortfalls at high prices on the spot market.

As it burned through cash, Uniper had already drawn a 2 billion-euro credit line from KfW and started talks about additional funds after getting 8 billion euros in financing earlier this year from Fortum. 

Germany couldn’t afford to let Uniper fail as the fallout would ripple through the economy, hitting industrial companies and local utilities served by Uniper. While flows on a key gas link with Russia have resumed after 10-day maintenance, deliveries remain significantly reduced and storage levels are low.

On Thursday, Germany raised its targets for gas storage, reflecting growing concern about having enough energy to heat homes and keep factories running through the winter. The move increases the likelihood that the government will intervene in managing reserves. 

Germany’s gas storage hasn’t increased since Tuesday and currently stands at about 65%. To reach the 95% level targeted for Nov. 1, the country would need nearly three months at the average fill rates in the week before the Nord Stream pipeline was halted.

Economy Minister Robert Habeck has warned that Russia’s gas squeeze posed the risk of Lehman Brothers-like contagion with Uniper’s failure potentially spilling over to the wider economy. The International Monetary fund estimated that the country is at risk of losing almost 5% of economic output if Russia shuts off gas supplies.

(Updates with market move in the fifth paragraph.)

©2022 Bloomberg L.P.