(Bloomberg) -- Germany’s economy proved more resilient in the third quarter than initially reported, growing 0.4% on strong consumer spending. 

An initial reading of 0.3% already had been a positive surprise, defying the country’s struggles with surging energy costs and uncertainty stoked by Russia’s war in Ukraine. Data published Friday showed that growth was primarily driven by household consumption, which registered a 1% increase from the previous quarter.

“Despite continuing sharp price increases and the expanding energy crisis, consumers took the opportunity to travel and go out more,” the statistics office said in a statement. “The German economy remains robust.”

The months ahead are set to be more challenging: Europe’s largest economy is widely expected to endure a recession as companies and households buckle under the energy-price spike. Its extent, is however, “extremely uncertain,” according to the Bundesbank, and the risk of damaging natural gas shortages has receded thanks to unusually warm autumn weather and storage facilities that are almost full.

Chancellor Olaf Scholz’s government is also preparing wide-ranging measures to subsidize gas and electricity, mitigating the hit to incomes from the highest inflation since the creation of the euro.

A gauge of business expectations by the Ifo institute rose on Thursday, reflecting optimism that the recession could be less severe than initially feared. Sentiment in surveys of purchasing managers by S&P Global this week also didn’t deteriorate further as economists had predicted.

--With assistance from Kristian Siedenburg and Bryce Baschuk.

©2022 Bloomberg L.P.