The country's federal, state and local governments together achieved an overall surplus of 23.7 billion euros ($25 billion) last year.
The country's federal, state and local governments together achieved an overall surplus of 23.7 billion euros ($25 billion) last year, according to Germany's statistics office Destatis.
"In absolute terms, this was the highest surplus achieved by general government since German reunification," it said in a statement.
Measured against gross domestic product (GDP), the surplus amounted to 0.8 percent of overall output, the statisticians calculated.
In 2015, Europe's top economy ran up a surplus of 19.4 billion euros or 0.6 percent of GDP.
Under eurozone rules, member states are not allowed to run up deficits in excess of 3.0 percent of GDP and are obliged to bring them into balance or surplus in the medium term.
Last year marked the third year in a row that Germany's public finances have been firmly in the black.
The surplus of the federal government alone was 7.7 billion euros in 2016, lower than the 10 billion accumulated in 2015, as it faced huge expenditures to cope with to a record influx of migrants and refugees.
Separately, the statistics office on Thursday confirmed a preliminary estimate that the economy expanded by 0.4 percent in the fourth quarter of last year.
For the whole of 2016, GDP grew by 1.9 percent.
"The economic situation in Germany in 2016 thus was characterised by solid and steady growth," Destatis said, underpinned by strong domestic demand.