At just over €357 billion, tax revenue outweighed spending by €13.5 billion last year, the federal Finance Ministry said.
“We had some luck, and also we did a good job managing” the money, finance minister Olaf Scholz told reporters in Berlin.
The ministry said that interest payments on Germany's remaining debts had turned out lower than forecast, while tax revenues climbed higher than predicted.
Scholz, of Chancellor Angela Merkel's centre-left junior coalition partners the SPD, has stuck to conservative predecessor Wolfgang Schäuble's “black zero” policy of no new debts.
But calls have grown louder over the past year for Germany to shake off its self-imposed spending shackles to rejuvenate crumbling infrastructure at home and – proponents hope – juice growth across the euro single currency bloc.
In both 2018 and 2019, Germany narrowly escaped “technical” recessions – two successive quarters of economic contraction.
Its export-oriented industries have suffered from US-led trade wars and uncertainty over geopolitical events like Brexit, as well as weaker global growth.
For 2020, the Bundesbank central bank forecasts growth of just 0.6 percent as the country keeps grinding through the weak patch.
Official data due to be released on Wednesday is expected to show similarly anaemic 2019 expansion.
Across the eurozone, “in view of the weakened economic outlook… governments with fiscal space should be ready to act in an effective and timely manner,” European Central Bank chief Christine Lagarde urged last month, echoing predecessor Mario Draghi.
Under Scholz, Germany has trumpeted increased investment, and argued that administrative and planning bottlenecks, rather than miserliness by politicians, are holding up spending boosts.
The Finance Ministry pointed Monday to a “record level” of federal investment spending, at €38.1 billion.
It added that 2019's surplus would allow investments to be “significantly increased” in the coming years.
“We can deploy this money sensibly for the future,” Scholz said.
But parliamentary finance committee member Hans Michelbach, a member of Merkel's conservative CSU allies, urged tax cuts instead.
“The latest budget surpluses contradict the finance minister's claim that there is no room to ease the burden on citizens,” Michelbach said.