Germany's economy will contract next year as a dramatic rise in energy costs due to the war in Ukraine extinguishes the chances of recovery after pandemic-related lockdowns, the Ifo institute said on Monday in a U-turn from its forecast three months prior.

The institute reversed its June forecast of 3.7% growth for 2023 and now predicts that Europe's largest economy will contract by 0.3%. At the same time, it bumped up its forecast for 2023 inflation by 6 percentage points to 9.3%.

For 2022, Ifo lowered its growth forecast to 1.6% from 2.5% and raised its inflation forecast to 8.1% from 6.8%.

"The cuts in gas supplies from Russia over the summer and the drastic price increases they triggered are wreaking havoc on the economic recovery following the coronavirus," said Timo Wollmershaeuser, head of Ifo's economic forecasts.

The first quarter of 2023 will be particularly rough for consumers as energy suppliers adjust their prices in response to high procurement costs, driving inflation to around 11%, said the institute.

As a result, households will see their purchasing power decline, with a government relief package mitigating the blow but falling far short of offsetting it, the institute said.

"The loss of purchasing power, as measured by the decline in real per capita wages this year and next by about 3 percent each, is higher than at any time since the current system of national accounts was introduced in 1970," Wollmershaeuser said.

Price increases should gradually weaken over the course of the coming year - calculated under the assumption that there will be enough gas in winter - and energy prices will begin sinking in spring 2023 at the latest, said the institute.

For 2024, the Ifo, part of a group of institutes whose estimates form the basis for the government's own forecast, predicts economic growth of 1.8% and inflation at 2.5%.

The German economy grew slightly in the second quarter, propped up by household and government spending.

(Reporting by Rene Wagner and Miranda Murray, editing by Rachel More and Philippa Fletcher)