The surplus was greater than in 2015, when Germany recorded a budget surplus of €19.4 billion, or 0.6 percent of GDP.
"In absolute terms, this was the highest surplus achieved by the general government since German reunification," Destatis reported.
Revenue was higher than expenditure at all levels of government: the largest surplus was achieved by social insurance funds (8.2 billion euros), followed by the central government (7.7 billion euros) and state governments (4.7 billion euros).
The last time Germany ran a budget deficit was in 2013, when the government's net borrowing was 0.2 percent of GDP.
The EU's Stability and Growth Pact states that member states are not allowed to run up budget deficits of more than 3 percent of GDP, otherwise sanctions may be imposed.
In addition to a large budget surplus, Germany also achieved a record export surplus of 252.9 billion euros ($267.6 billion) in 2016.
EU politicians and officials such as French Finance Minister Michel Sapin and ECB President Mario Draghi have called on Berlin to loosen its purse strings and invest more in order to stimulate more growth in the Eurozone.
Earlier this month, Sapin told the German newspaper Handelsblatt that in order to increase growth in the Eurozone, countries such as Germany need to boost investment, which would stimulate consumption and imports from weaker Eurozone countries.
"Germany could be more ambitious in this area … if we all only pull in one direction, namely reducing budget deficits, the adjustments (in Europe) will be even harder," Sapin said.
On Wednesday, EU Economic Affairs Commissioner Pierre Moscovici also called on Germany to invest more.
"In Germany’s case, we see once again that a very large current account surplus is not healthy for the economy and additionally, creates very significant economic and political distortions for the entire eurozone," Moscovici said.
#Eurozone upturn steps up a gear as growth approaches 6-year high. Flash #PMI Composite Output Index at 56.0 in Feb. https://t.co/2rKJihWdiX pic.twitter.com/zHKpS4f1dM
— Markit Economics (@MarkitEconomics) 21 февраля 2017 г.
Nevertheless, Eurozone growth has picked up in recent months. On Tuesday, HIS Markit released a survey of services and manufacturing activity which found that this month's business activity in the Eurozone had reached its highest level since April 2011.