Inflows into federal, state and municipal coffers outweighed spending by €36.6 billion in 2017, Destatis said in a statement.
That was smaller than the statisticians' January estimate of €38.4 billion, but still the highest-ever surplus since German reunification in 1990.
The extra cash amounted to around 1.1 percent of Germany's €3.26-trillion GDP last year.
In a separate release, Destatis confirmed that GDP grew 0.6 percent in the fourth quarter of 2017 and 2.2 percent over the whole year, the fastest rate since 2011.
Feeling flush, Chancellor Angela Merkel's conservatives and prospective junior partners the Social Democratic Party (SPD) have planned to loosen the purse strings over the coming four years – as long as SPD members approve their coalition deal in an internal referendum.
If Merkel is sworn in for a fourth time next month, higher spending on areas like healthcare and care for the elderly, infrastructure investment and contributions to the European Union budget could follow.
But with both parties committed to maintaining a balanced budget, slightly increased largesse from Berlin is unlikely to satisfy Germany's partners abroad or international organisations like the International Monetary Fund.
They have called on Europe's largest economy to reduce its massive trade surplus by spending more at home.