(Bloomberg) -- Siemens Energy AG has secured a €15 billion ($16.2 billion) deal with the German government, its biggest shareholder Siemens AG and a consortium of banks, as the troubled manufacturer weathers massive losses at its wind-turbine unit. 

Private banks will provide Siemens Energy with €12 billion in loan guarantees, backed by €7.5 billion in so-called counter-guarantees from the government, the Economy Ministry said Tuesday. The measures will allow Siemens Energy to compete for new contracts after its financing options became strained.

About €3 billion more will come from other stakeholders, according to the statement. That includes Siemens, which will purchase part of Siemens Energy’s stake in a listed Indian affiliate for roughly €2 billion. Siemens will also cover a €1 billion first-loss tranche for the banks’ loan guarantees, the government said. 

Read more: Siemens Energy’s Faulty Wind Turbines Become Germany’s Problem

The agreement brings an end to weeks of negotiations over how to help the manufacturer, which has said it needs the financial backstop to win new large-scale contracts for transmission networks and gas turbines. While those units are profitable, a string of losses from the company’s Gamesa wind unit has been straining its balance sheet. 

Siemens Energy shares were 2.4% at 4:48 p.m. in Frankfurt. The stock slumped more than 35% on Oct. 26 when news of the talks broke, having since recovered from those losses. The stock remains roughly 42% down since the start of the year. 

Talks with the government began after Siemens Energy’s credit rating was downgraded this summer and as Siemens, the manufacturer’s former parent, indicated it was no longer willing to help. German Chancellor Olaf Scholz upped pressure on Siemens to agree to a deal in the past week, and said the government sees Siemens Energy as critical for the nation’s transition to renewable energy.

A spokesperson for Siemens Energy in a statement praised the government’s support and said the company will provide further details Wednesday, when it’s scheduled to report earnings and give an update of estimated costs for the turbine problems. 

The deal still needs formal approval from the German government, as well as the Siemens Energy and Siemens boards. A spokesperson for Siemens said it will share details as soon as governance approvals are in place and contracts executed.

Siemens, which still holds a 25.1% stake in Siemens Energy after hiving off the business in 2020, merged its long-standing offshore Siemens Wind Power unit with Gamesa in 2017, creating the world’s biggest wind-turbine maker measured by installations at the time.

Munich-based Siemens Energy has been struggling for years to get on top of Gamesa in what has turned into one of Germany’s biggest industrial debacles. In August, the company said mounting issues with malfunctioning turbines and unprofitable contracts are set to push the company to a €4.5 billion net loss this year.

The problems at Gamesa center on the rushed development of the 5.X wind turbine, which has proven prone to breaking down because a main piece on the frame of the component can move or twist over time, potentially damaging other critical components. The wind business, like the rest of the industry, is also weighed down by unprofitable contracts because of ballooning raw material costs and tough competition. 

The Economy Ministry on Tuesday said it’s working on a program to finance the construction of offshore converter platforms, while the European Investment Bank is developing a plan for guarantees for the wind industry.

(Updates with additional details throughout.)

©2023 Bloomberg L.P.