The German economy ended the year with a healthy surplus of nearly €24 billion.
Not only was 2016 the third consecutive year in which government revenue was greater than spending, but the largest surplus since the country’s reunification in 1990.
"In absolute terms, this was the highest surplus achieved by general government since German reunification," the German federal statistics agency said in a statement.
Germany benefitted from increased employment and more money paid in taxes, although it also had to spend more on housing and integrating refugees.
The statistics office said an increase in income and in property taxes accounted for the “considerable growth” in social contributions.
An estimated €7.7 billion of the surplus will, by law, will be given to a government fund to support refugees.
More money, according to Chancellor Angela Merkel, will now be devoted to defence, domestic security and social improvements.
Strong spending by German residents pushed the economy into 0.4% growth in the last quarter of 2016. At the same time, however, the statistical office said that foreign trade of goods and services rose by 3% over 2015, but imports increased by 4.5%.
On Wednesday the European Commission said that Germany’s surplus was too large.
It said that cutting that surplus would help the whole of the eurozone.