WIESBADEN - The German economy notched up its weakest growth in four years last year, as Europe's biggest economy increasingly feels the pain from the region's debt crisis, official data showed on Tuesday.

Nevertheless, analysts believe the lull in growth will prove only temporary.

And for the first time in five years, Germany was able to get its finances in order and achieve a modest public surplus thanks to record low unemployment and record low interest rates.

German gross domestic product (GDP) shrank by around 0.5 percent in the fourth quarter of last year, bringing full-year growth to just 0.7 percent, the federal statistics office Destatis calculated in preliminary data.

In 2010 and 2011, the German economy had expanded by 4.2 percent and 3.0 percent respectively. The government's forecast for 2012 had been around 0.75 percent.

Throughout the crisis, Germany has fared a great deal better than its neighbours thanks to deep and painful economic reforms undertaken a number of years ago.

But with many eurozone members in recession, Germany has not been able to remain completely immune, with growth slowing particularly in the latter half of last year.

After expanding by 0.5 percent in the first quarter, 0.3 percent in the second quarter and 0.2 percent in the third quarter, Destatis' top statistician Norbert Raeth said GDP likely contracted by "around a quarter of a percentage point" in the period from October to December.

Destatis is not scheduled to publish more precise fourth-quarter GDP data until next month.

Nevertheless, Destatis president Roderich Egeler pointed out that Germany was still faring much better than most of its European neighbours, many of which were in recession.

"Overall, the German economy proved itself to be very robust," Egeler insisted.

Growth continued to be driven by strong exports, which grew by 4.1 percent last year, state spending which rose by 1.0 percent and private consumption which increased by 0.8 percent.

Investment, on the other hand, was weak.

Destatis said the comparative robustness of the German economy meant it had been able to get its finances in order, too.

For the first time in five years, the overall state budget -- which covers both the German government, the regional and municipal authorities, as well as the social welfare administration -- showed a surplus of 2.2 billion euros ($2.9 billion), equivalent to 0.1 percent of GDP, Egeler said.

In 2011, the overall state budget had shown a deficit ratio of 0.8 percent.

ING Belgium economist Carsten Brzeski predicted that Germany's sound economic fundamentals "should ensure another solid growth performance in 2013."

Private consumption should remain stable and "financing conditions have never been more accommodative in Germany than at present," he said.

"If uncertainties surrounding the euro crisis and the global economy ebb away further, pent-up investment could become an important growth driver," Brzeski said.

UniCredit economist Andreas Rees said that despite the weak full-year performance and the contraction in the fourth quarter, "the German economy's performance last year is still a remarkable one."

"Both companies and consumers managed to hold their ground in turbulent times, especially in the first half of 2012 when eurozone break-up fears on financial markets were looming high," he said.

And strong exports "clearly reflect German companies' success in further opening up export markets outside the eurozone," he said.

Rees also believed "some kind of investment pent-up demand has built up over time which might be 'unloaded' already from the first quarter."

"It goes without saying that the sine qua non is a further calming of financial markets and additional progress in tackling the eurozone crisis. But in our view, the outlook for financial markets and the general economic backdrop in Germany and abroad is promising," he said.

"To put it in a nutshell, the German economy will continue to steer its course this year -- despite a very weak year-end 2012," Rees said.

Natixis economist Christian Ott said he, too, was pencilling in "a gradual recovery in the course of 2013. However, it will be a year of sluggish growth" of around 0.6 percent, he said.