Germany's economy shrank during the April-to-June period of this year.
A decline in exports dampened growth, according to official data, which comes amid concerns of a global slowdown.
Gross domestic product (GDP) fell by 0.1% compared with the previous quarter, according to the Federal Statistics Office.
That takes the annual growth rate down to 0.4%. Germany, Europe's largest economy, narrowly avoided a recession last year.
Early signs for the third quarter "look ominous", said Andrew Kenningham, chief Europe economist at Capital Economics. "Manufacturing business surveys for July were all gloomy.
"And while the services sector should continue to hold up better, there are some signs that the slump is spreading to the labour market."
Trade war woes
While the overall figures were negative, household and government expenditure increased, as did investment outside the construction sector.
Construction itself fell after an unusually good first three months, boosted by a mild winter.
"The development of foreign trade slowed down economic growth because exports recorded a stronger quarter-on-quarter decrease than imports," the statistics office said.
The US-China trade war and the UK's departure from the EU, especially if it happens without a deal, are among factors affecting global economic confidence.
Last month, the International Monetary Fund cut its growth forecasts for the global economy for this year and next, citing US-China tariffs, US car tariffs and no-deal Brexit.
China's own economic slowdown has weakened demand for foreign goods. It is an important market for Germany, since it buys plenty of luxury cars.
Only the much larger economies of the US and China export more goods than Germany.
The results may make authorities consider more monetary stimulus, said Neil Wilson, chief market analyst for Markets.com.
Meanwhile, the European Central Bank has hinted it could cut interest rates to tackle a slowdown in the eurozone economy.
The ECB said last month that a weak manufacturing sector and uncertainty over Brexit and trade threatened to derail growth. It forecast rates at current or lower levels until mid-2020.