•The deal will see the German government take on a 98.5% stake in the firm at a cost of €8.5bn (£7.4bn).
•Germany is Europe's biggest importer of Russian gas, and has been particularly squeezed as Russia has reduced supplies in recent months.
Germany is to nationalise gas giant Uniper in an effort to secure energy supplies amid the war in Ukraine.
The deal will see the German government take on a 98.5% stake in the firm at a cost of €8.5bn (£7.4bn).
Germany is Europe's biggest importer of Russian gas, and has been particularly squeezed as Russia has reduced supplies in recent months.
Chief executive Klaus-Dieter Maubach said the deal would help Uniper's role as "a system-critical energy supplier".
Before Russia's invasion of Ukraine it supplied Europe with about 40% of its natural gas, and has responded to Western sanctions by gradually cutting off supplies.
At the start of this month, it halted supplies through the Nord Stream 1 pipeline, claiming repairs were needed - but later said supplies would not resume until sanctions were lifted.
Uniper is the biggest buyer of Russian gas in Germany. In recent months it has had to replace Russian supplies with alternatives from the open market, where prices have soared.
Uniper's Finnish owner Fortum said the company has accumulated close to €8.5bn (£7.4bn) in gas-related losses "and cannot continue to fulfil its role as a critical provider of security of supply as a privately-owned company".
"The role of gas in Europe has fundamentally changed since Russia attacked Ukraine, and so has the outlook for a gas-heavy portfolio," Fortum chief executive Markus Rauramo said in a statement.
"As a result, the business case for an integrated group is no longer viable."
Under the terms of the deal, the German government will buy Fortum's shares in Uniper for €500m (£437m) and inject €8.0bn (£7.0bn) of cash into the business.
The government had already taken on a 30% stake of Uniper as part of a bailout agreement in July.
Earlier this month, it also entered discussions with another major gas supplier, VNG, over a possible bailout package.
Economy minister Robert Habeck said nationalising Uniper was a "necessary" step that would help "ensure security of supply for Germany".
He also said that, despite the loss of Russian supplies, Germany had succeeded in filling its gas storage facilities to over 90% capacity ahead of winter.
"This means that, as a whole, we have coped quite well with the situation," he said. "But for Uniper the situation became significantly more dramatic and significantly worse."
At the start of September, Germany introduced a series of measures intended to cut energy use and stave off shortages over the coming months.
Businesses are no longer allowed to keep their doors open throughout the day to reduce the need for heating, and illuminated advertising must be switched off after 10pm.
The halls and corridors of most public buildings will no longer be heated, and offices can only be heated to a maximum of 19C.
In July, energy ministers across Europe also agreed to reduce their natural gas consumption by 15%.