Germany is going to nationalize Uniper in order to secure energy supplies.
The German government will acquire a 98.5% stake in the firm at a cost of 8 billion.
Germany is Europe's biggest importer of Russian gas and has been squeezed by reduced Russian supplies.
Uniper's role as a system-critical energy supplier will be helped by the deal, according to the chief executive.
Europe used to get 40% of its natural gas from Russia before the war in Ukraine.
At the beginning of the month, it halted supplies through theNord Stream 1 line, but later said it would not resume until sanctions were lifted.
Uniper buys a lot of Russian gas. In the last few months it has had to replace Russian supplies with other supplies from the open market.
According to Fortum, the company has accumulated close to 8 billion in gas-related losses and can't continue to fulfill its role as a private company.
Since Russia attacked Ukraine, the role of gas in Europe has fundamentally changed, and so has the outlook for a gas-heavy portfolio, according to Fortum.
The business case for an integrated group is no longer viable due to this.
The German government will purchase Fortum's shares in Uniper for 500m and inject billions of dollars into the business.
In July, the government took on a 30% stake in Uniper.
VNG, a major gas supplier, entered discussions with it over a possible bail out.
Robert Habeck, the economy minister, said nationalising Uniper was necessary to ensure security of supply for Germany.
Despite the loss of Russian supplies, Germany was able to fill its gas storage facilities to over 90 percent capacity.
He said that the situation has been dealt with well. The situation became dramatically worse for Uniper.
Germany introduced a series of measures at the beginning of September to cut energy use.
Businesses are no longer allowed to keep their doors open throughout the day to reduce the need for heating and illuminated advertising must be stopped after 10pm.
Offices can only be heated to a maximum of 19C in most public buildings.
European energy ministers agreed in July to reduce their natural gas consumption.