German exports slumped by 2.0 percent in the fourth quarter of 2012, causing the overall economy -- Europe's biggest -- to contract by 0.6 percent, official data showed on Friday.
The federal statistics office Destatis had already estimated in preliminary data last week that German gross domestic product (GDP) shrank by 0.6 percent in the October-December period.
The office confirmed that estimate Friday and also provided a breakdown of the different GDP components.
While private consumption grew by 0.1 percent and state spending was up by 0.4 percent in the period from October to December, construction investment eased by 0.1 percent and investment in equipment fell by 2.0 percent, the statisticians calculated.
Overall, domestic demand edged up by 0.2 percent in the fourth quarter.
"By contrast, foreign trade had a negative effect on the economic development, with exports of goods and services falling by 2.0 percent," Destatis said.
With imports also declining by 0.6 percent, the foreign trade component knocked 0.8 percentage points off GDP growth in the October-December period, it said.
Economic growth in Germany slowed throughout all of last year as the eurozone debt crisis put the brake on exports.
GDP grew by 0.5 percent in the first quarter of 2012 and then by 0.3 percent in the second quarter and 0.2 percent in the third quarter.
With the contraction of 0.6 percent in the fourth quarter, the economy expanded by just 0.7 percent across the whole of 2012, compared with 3.0 percent in 2011, Destatis said in a statement.
The statisticians noted, however, that due to the timing of the Christmas holidays, there were three fewer working days in 2012 than in 2011.
Adjusted for that effect, the German economy grew by 0.9 percent overall last year, they calculated.
Destatis also said Germany's public finances were back in the black for the first time in five years, with the overall public budget showing a surplus of 4.2 billion euros ($5.6 billion) for 2012.
Measured against GDP of 2.644 trillion euros for the year as a whole, that represented a surplus ratio of 0.2 percent, slightly higher than a preliminary estimate of 0.1 percent released in January, Destatis said.
It is the first time since 2007 and only the third time since unification in 1990 that Germany's finances have been in the black, the statistics authority said.
Under EU rules, member states are not allowed to run up deficits in excess of 3.0 percent of GDP.
In 2011, Germany's finances had been in the red with a deficit equivalent to 0.8 percent of GDP.