The national statistics office Destatis calculated that gross domestic product (GDP) contracted by 0.6 percent in price, calendar and seasonally adjusted terms in the period from October to December.
Analysts and economists had been pencilling in a drop of 0.5 percent after´Destatis said in January that the economy had contracted by "around half a percentage point" at the end of last year.
Growth has indeed been slowing all year as the eurozone debt crisis puts 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.
The fourth-quarter data "offer mixed signals," Destatis said. "While consumer and state spending increased slightly, investment in construction was down and investment in equipment fell even more sharply," it said.
"The main reason behind the contraction was foreign trade, which was relatively weak in the final quarter of 2012. Exports of goods declined more sharply than goods imports," Destatis explained.
In France, the economy shrank by 0.3 percent in the forth quarter and was weaker than expected, official data showed. Growth for the whole year in France was zero.
Economists are confident, however, that the dip in growth in Germany will be only short-lived and that the German economy will start expanding again in the first quarter of this year.
ING Belgium economist Carsten Brzeski said that "with increased uncertainty stemming from the euro crisis and the global economic cooling in the second half of the year, the German economy has finally lost its invincibility.
"Looking ahead, however, there is increasing evidence that the economy should pick up speed again very quickly," Brzeski said.
Confidence indicators have improved over the last three months and the new optimism is not only wishful thinking, as evidenced by rising industrial orders, he said.
"All in all, even if today's numbers are disappointing, they are no reason to start singing the blues on the German economy. The contraction should be a temporary gaffe rather than a new worrying reality," he said.
Commerzbank chief economist Jörg Krämer agreed.
"Previous economic cycles suggest that the recent rise in early indicators will feed through into the hard data fairly quickly," Krämer said.
"In the first quarter of 2013, the German economy will grow noticeably again. For 2013 as a whole, we're projecting an increase of 1.0 percent," he said.
Newedge Strategy analyst Annalisa Piazza cautioned that the weaker-than-expected data in both France and Germany spelled bad news for the eurozone as a whole.
"This is the weakest quarterly reading since the first quarter of 2009," Piazza said. "With both France and Germany GDP down more than expected, we now see risks for eurozone GDP to have contracted by 0.5 percent, confirming the picture of another year of recession," she concluded.