The German economy shrank in the final three months of 2023, the statistics office said on Tuesday, with economists increasingly warning of another technical recession for Europe's largest economy in the first quarter of 2024.

Gross domestic product contracted by 0.3% in the fourth quarter compared to the previous quarter, in line with analysts' expectations, according to a Reuters poll.

The German economy shrank by 0.3% over the course of last year, due to persistent inflation, high energy prices and weak foreign demand.

However, because GDP stagnated in the second and third quarters, the euro zone's largest economy was able to avoid another technical recession, commonly defined as two successive quarters of contraction.

This is expected to be short-lived, with the Ifo institute forecasting on Tuesday a 0.2% decline in GDP in the first quarter of 2024.

"Private consumption, on which the optimists are counting, has disappointed right up to the end," said Commerzbank economist Joerg Kraemer.

"The recent fall in industrial production and the low level of the Ifo business climate indicate that the German economy also contracted in the first quarter," he added.

Alexander Krueger, economist at Hauck Aufhaeuser Lampe, noted that economic output was no higher in Germany than it had been four years ago. "A lack of growth is en vogue in this country," he said.

However, despite an outlook spelling stagnation at best in the coming quarters, Thomas Gitzel of VP Bank said easing inflation offered a silver lining. The consumer price index expected to return towards the European Central Bank's 2% target by the middle of the year.

"This will then give European monetary authorities room for manoeuvre to cut interest rates. This will benefit companies and consumers, but above all the ailing construction industry," Gitzel said. (Reporting by Rachel More Editing by Madeline Chambers, Matthias Williams and Ros Russell)