The German economy, the major driver of euro zone growth, expanded by 1.9 percent in 2016, the strongest rate in five years, a preliminary estimate from the Federal Statistics Office showed on Thursday
Europe's largest economy is benefiting from rising private consumption and increased state spending on refugees, compensating for a weaker contribution from trade amid sluggish demand from major trading partners and emerging markets.
Economists polled by Reuters had expected growth in gross domestic product (GDP) of 1.8 percent for 2016 after an expansion rate of 1.7 percent in the previous year. The growth rate of 1.9 percent matched the highest forecast in the poll.
The Statistics Office said it estimated growth was around 0.5 percent for the fourth quarter.
"The German economy in 2016 once again defied an entire series of downside risks, thanks to strong domestic demand," said ING economist Carsten Brzeski, adding that Germany's biggest risk now was complacency.
"The economy urgently needs new impetus from new structural reforms and stronger public and private investment. It is very unlikely that it will get any of these before the elections," he said.
Germany goes to the polls for a federal election in September.
A breakdown of the 2016 GDP figures showed private consumption rose by an adjusted 2.0 percent on the year, contributing 1.1 percentage points to the overall 2016 growth rate.
State spending jumped by 4.2 percent after a rise of 2.7 percent in 2015. The increased state spending added 0.8 percentage points to the overall growth rate.
Investment in machinery and equipment contributed 0.1 percentage points while construction added 0.3 points. As exports rose less strongly than imports, net foreign trade subtracted 0.1 percentage point from the overall growth rate.
Germany's Ifo economic institute said last month the economy will rebound more strongly than previously expected in the fourth quarter and this growth momentum will carry through into 2017.
Germany's economy accelerated slightly last year to grow by 1.9 percent, narrowly beating expectations thanks largely to household and government spending, official data showed Thursday.
The figure released by the Federal Statistical Office was slightly better than Germany's performance in the previous two years, and also a bit above the 1.8 percent growth that the government and economists had forecast. Gross domestic product increased by 1.7 percent in 2015 and 1.6 percent in 2014.
The statistical office offered a rough estimate that the economy grew by about half a percent in the fourth quarter compared with the previous three-month period. However, an official fourth-quarter figure won't be released until next month, and statisticians warned that the estimate should be treated with caution.
Domestic spending once again powered the economy, which is traditionally export-heavy, to stronger growth.
Household spending was up 2 percent last year and government consumption spending 4.2 percent, the latter partly a result of spending to deal with the previous year's large influx of asylum-seekers. Investment in construction was up 3.1 percent and spending on equipment such as machinery and vehicles rose 1.7 percent.
Foreign trade had a slightly negative impact on GDP as a 3.4 percent rise in imports outpaced a 2.5 percent increase in exports.
Germany has now enjoyed seven consecutive years of economic growth, a contrast with weak performances in many other European countries. That has translated into healthy government finances.
The country had a 19.2 billion-euro ($20.2 billion) budget surplus last year, or 0.6 percent of GDP. That was the third consecutive annual fiscal surplus, down slightly from the previous year's 0.7 percent.
Of the 18 other eurozone countries, only Estonia and Luxembourg are expected to have produced a surplus last year, statistical office head Dieter Sarreither said.
"Despite the stock market crash in China, Brexit, Turkey, Trump and Italy, the economy performed its best growth year since 2011," said ING-DiBa economist Carsten Brzeski. "Strong domestic demand has shielded the German economy against most external risks."He argued that the biggest risk is complacency, and that Germany urgently needs structural reforms along with stronger investment — but "it is very unlikely that it will get any of these before the elections" expected in September.