The German economy shrank by 0.2% in the last quarter of 2004 from the previous quarter, according to an initial estimate by the federal statistics office.
Analysts had forecast the euro zone's biggest ecconomy would grow 0.2% in the last quarter of 2004.
The statistics office, Destatis, said the contraction in fourth-quarter GDP was due to a decline in domestic demand, which was only partially compensated for by a rise in the export surplus.
It also said that the German economy stagnated in the third quarter from the second quarter, revising down slightly an earlier estimate that the economy grew 0.1%.
For the whole of 2004, it also trimmed back its estimate to 1.6% growth from 1.7% previously.
The news of the economic contraction will be all the more unwelcome in the face of unemployment which currently stands at a post-WW2 high of more than five million in Germany.
The weak growth could torpedo the government's goal of bringing down its public deficit this year, which has exceeded EU limits for three years in a row.