Europe's biggest economy exported a record €1.097 trillion ($1.5 trillion) worth of goods in 2012, an increase of 3.4 percent from the level the previous year, the national statistics office Destatis said.
Imports, too, topped a new record, inching up 0.7 percent to €909.2 billion in the period from January to December.
That meant the trade surplus increased to €188.1 billion in 2012, the highest level since 2007 and the second-highest level since foreign trade statistics began in 1950, Destatis said in a statement.
Nevertheless, trade momentum tailed off sharply towards the end of the year as the effects of the eurozone sovereign debt crisis increasingly left their mark on the region's powerhouse economy, the data showed.
In December alone, exports advanced by just 0.3 percent from November, failing to offset a 2.2-percent decline seen the previous month.
And imports – a measure of domestic demand – actually declined by 1.3 percent after already contracting by 3.8 percent in November. Germany has held up much better to the crisis than its eurozone partners, many of which are in recession.
But with the EU and the single currency area accounting for the lion's share of German exports, the country has not been able to escape the crisis unscathed.
And after growth slowed noticeably throughout the course of the year, the economy actually went into reverse in the fourth quarter, when it contracted by an estimated 0.5 percent. Analysts said the trade data reflect this.
"The overall outlook for trade activity remained extremely poor in the fourth quarter," said Newedge Strategy analyst Annalisa Piazza.
"There are clear risks that trade activity might have been a drag for gross domestic product growth over the quarter," she said.
Destatis is scheduled to publish fourth-quarter GDP data next week.
Natixis economist Johannes Gareis said "the export numbers today confirm our scenario of a weak growth in Germany in the fourth quarter, due to the consistent weakness in world trade."
But he was confident that trade would stabilise in the first quarter of 2013 "as already indicated by leading indicators released this month."
Christian Schulz at Berenberg Bank predicted that "German domestic demand and thus imports should benefit this year from the lifting of the uncertainty related to the euro crisis.
"At the same time, exports could be under pressure from continuing demand weakness in peripheral Europe and the stronger euro exchange rate," he cautioned.
Exports provide a vital part of the German growth mix. Meanwhile eurozone countries struggling to overcome debt problems are working hard to boost their export performance to push up growth and tax income.