Strong economic growth and low unemployment led the federal government, the German states and local councils to record a total surplus of €23.7 billion, the federal statistics agency (destatis) announced on Thursday.
"In absolute terms, this was the highest surplus achieved by general government since German reunification," it said in a statement.
In 2015, Europe's top economy ran up a surplus of €19.4 billion or 0.6 percent of GDP.
The healthy economic figures for 2016 meant a surplus of 0.8 percent of GDP, higher than an estimate of 0.6 percent issued by destatis in January.
It was the third year in a row that Germany has recorded a budget surplus, putting it far above the deficit limit set out by the Maastricht Treaty, according to which a country is forbidden from running a deficit higher than 3.0 percent of GDP.
The graph shows deficits and surpluses since 1991 in billions of euros.
Broken down, the welfare system recorded a surplus of €8.2 billion. The federal government took in €7.7 billion more than it spent, a drop from €10 billion in 2015. The states and local councils also more than balanced their books.
The surplus was thanks largely to a year of strong economic growth. Despite a dent in the figures in the third quarter, economic output increased by 0.4 percent between October and December, contributing to GDP growth of 1.9 percent in the year.
According to destatis, healthy domestic consumption was partly responsible for growth in the economy in the fourth quarter.
Germany has been criticized recently for relying on export markets rather than domestic ones, but imports increased more rapidly than exports over the course of the year.
“The growth in the German economy should get even stronger in the first quarter of 2017,” the Bundesbank (federal bank) reports in its most recent monthly evaluation.
Criticism from abroad
Germany has in particular come under fire over its massive trade surplus, which grew to a record 253 billion euros in 2016, drawing fierce criticism from the new US administration.
US President Donald Trump's top trade advisor Peter Navarro last month accused Berlin of using a weak euro to gain a trade advantage, while Trump himself has promised tough action to restore the balance.
"The German economy is clearly somewhat imbalanced," Jennifer McKeown of Capital Economics told AFP.
"The only real way for Germany to address this is through stimulus that would boost domestic spending. But these budget surpluses are implying that isn't happening."
While Chancellor Angela Merkel's government has tended to turn a deaf ear on such complaints in the past, a tight general election coming up in September could force more debate on the issue.
Merkel's junior coalition partners the Social Democrats, who are riding high in the polls, "have spoken about fiscal loosening", McKeown said.
But in a country where voters view fiscal prudence favourably, she said she was not expecting "a major turnaround".
Merkel hit back at the grumbles on Thursday, pointing out that the federal government surplus was only part of the overall surplus, giving her little to work with.
The chancellor, who is hoping for a fourth term, said the government planned to spend more on "internal and external security" as well as social security, but without running up new debts.
"That's why we have little room to manoeuvre," she said at a Berlin press conference.