Germany achieved a surplus in its public finances in the first half of this year, even though growth stalled in the second quarter, official data showed on Monday.
The federal, regional and municipal budgets showed a combined surplus of 16.1 billion euros ($21.1 billion) in the period from January to June.
This was driven mainly by a "very favourable employment situation," the federal statistics office Destatis said in a statement.
Measured against overall gross domestic product (GDP) of 1.426 trillion euros, that represented a ratio of 1.1 percent.
Under eurozone rules, member states are not allowed to run up deficit ratios of more than 3.0 percent and are obliged to bring their public budgets into balance or then surplus in the long term.
This performance contrasts with that of France, the second-biggest eurozone economy.
French unemployment is running at a record high level, growth is weak, forcing the government to half its forecast for this year to 0.5 percent, and to admit that it will overshoot its promises to the European Union to cut its overall public deficit to 3.8 percent of GDP this year.
In Germany, the federal government alone achieved a surplus of 4.0 billion euros in the January-June period, the first time since 1991 that the federal budget has been in the black in the first half, Destatis said.
The regional states were able to almost balance their books as well, running up a deficit of just 200 million euros, compared with a surplus of 1.3 billion euros in the same period a year earlier.
The municipal authorities booked a surplus of 5.3 billion euros while the social and welfare budgets showed a surplus of 7.1 billion euros.
Public sector spending rose by 2.5 percent to 14.9 billion euros to 620.8 billion euros, Destatis calculated.
At the same time, the statisticians provided a breakdown of GDP figures for the second quarter, when Europe's biggest economy contracted by 0.2 percent.
Destatis calculated that consumer and public-sector spending both edged up by 0.1 percent in the period from April to June.
Investment, on the other hand, was down by 0.4 percent, with construction investment in particular falling by 4.2 percent, largely because much of it had been frontloaded to the first quarter as a result of the unusually mild winter weather.
Net foreign trade also weighed on GDP growth because imports grew faster than exports quarter-on-quarter, Destatis said.
- Solid fundamentals -
Analysts were convinced, however, that the dip in growth in the second quarter would prove only temporary.
"Looking ahead, we expect the German economy to return to growth in the remainder of this year on account of solid domestic fundamentals," said Natixis economist Johannes Gareis.
Business investment would likely remain at low levels in view of high uncertainty arising from the Ukraine crisis as well as a clouded outlook for growth in the euro area, the expert said.
"All in all, we expect the German economy to shift down a gear. For 2014 as a whole, we expect real GDP to grow by 1.5 percent," Gareis said.
Berenberg Bank economist Christian Schulz that "on many counts, Germany had a strong first half of the year."
However, "the key short term risk weighing on Germany's economy is the crisis in Eastern Ukraine," Schulz said.
According to confidence surveys, the so-called "Putin effect" has now spread to consumers as well.
"We cannot even rule out a brief recession," the expert continued.
"On the other hand, the European Central Bank's low interest rates and strong household fundamentals will also support growth, once the uncertainty starts to fade," Schulz said.
IHS Global Insight economist Timo Klein said that "much of the recovery observed between late 2012 and early 2014 remains intact" and Germany's near-term economic recovery prospects "remain at least fair."