The German public deficit - the gap between revenue and expenditure - amounted to €25.3 billion ($33.8 billion) or 1.0 percent of gross domestic output (GDP) in 2011, the national statistics office Destatis calculated in a statement.
A year earlier, it had stood at €105.9 billion or 4.3 percent of output.
This is a substantial reduction of the public deficit, and in a single year, by any standards.
Germany has the biggest economy in the European Union, and owing to the strength of its economy has been clearly the most powerful voice during negotiations on dealing with the eurozone debt crisis.
Eurozone countries are not supposed to run up deficits in excess of 3.0 percent of GDP, but the last time the German deficit ratio was below that ceiling was in 2008 when it stood at 0.1 percent.
Destatis said that revenues amounted to €1.148 trillion last year while expenditure stood at €1.173 trillion, against total GDP of €2.57 trillion.
The federal government and the regional governments of Germany's 16 states spent more than they received in revenues last year, running up deficits of €26.3 billion and €14.9 billion respectively, Destatis calculated.
By contrast, the municipal authorities ended the year with a modest budget surplus of €0.8 billion and the social welfare system achieved its biggest budget surplus of €15.1 billion since unification in 1991 thanks to the favourable situation on the labour markets, the statisticians said.
Germany has managed to shrug off the worst of the eurozone debt crisis thanks to deep structural reforms implemented in recent years, notching up robust growth of 3.0 percent last year, while unemployment fell to record lows.
Nevertheless, the sovereign debt crisis has not left Germany totally unscathed and growth shuddered to a halt at the end of the year, even if economists and officials believe it will quickly pick up again this year.
Already last week, official data showed that GDP contracted by 0.2 percent in the period from October to December.
According to a breakdown of the growth data published by Destatis on Friday, the contraction in activity was mainly due to a 0.8-percent drop in exports, traditionally the main driver of growth in the German economy.
Consumer spending also declined slightly by 0.2 percent, while state spending was up fractionally by 0.1 percent.
Only investment increased perceptibly in the three-month period, with construction investment up as much as 1.9 percent, the statisticians calculated.
Nevertheless, forward-looking indicators, such as the Ifo business climate index, all suggest that the dip in the German economy will prove only temporary and activity will begin to pick up again as soon as the first quarter of this year.
With unemployment set to remain low, domestic demand is expected to be able to offset any weakness in exports resulting from the debt crisis, economists say.
"There are signs that domestic activity is improving, albeit at a modest pace," said Newedge Strategy analyst Annalisa Piazza.
"Business confidence indicators show some resilience to external shocks for the German economy. However, uncertainties remain high. We expect German GDP to rise by a modest 0.2 percent in the first quarter of 2012 and by 1.0 percent in 2012," Piazza said.
On Thursday, the EU Commission in Brussels warned that the debt crisis will drag the eurozone into a long-feared double-dip recession this year, pulling down most neighbouring non-euro economies in its wake.
New data predicted a 0.3-percent contraction in GDP throughout 2012, compared with the previous estimate of 0.5-percent growth, indicating that deep challenges remained for the single currency area only days after a decision to mount a new €237 billion bailout of Greece.