GDP for the three months ended June contracted 0.1% compared to the previous quarter, in line with analyst expectations. That's down from 0.4% growth in the first three months of the year.
"Today's GDP report definitely marks the end of a golden decade for the German economy," said Carsten Brzeski, chief economist in Germany at the Dutch bank ING.
A challenging backdrop
The German economy has helped support growth in Europe following the global financial crisis.
But industrial output for June dropped over 5% compared to the previous year. And the ZEW indicator of economic sentiment for August plunged sharply, hitting its lowest level since December 201
Brzeski said the uncertain climate was a top negative factor. "Increased uncertainty, rather than direct effects from trade conflicts, has dented sentiment and hence economic activity," he said.
Throw Brexit into the mix, and the outlook for Germany's economy looks grim. Even so, Rakau said he expects a return to "modest" growth in the current quarter, helped by "resilient" domestic demand.
"The main question really is how exports and industry are going to fare," he said. 
What happens next
The weak data bolsters the case for the German government to spend more to stimulate the economy next year, Rakau said. But that's far from a sure bet in a country that's notoriously wary about borrowing.
The government could face more pressure to intervene if the trade was between the United States and China.
Germany's contracting economy also bolsters the case for the European Central Bank to take action when it meets in September.
Economists predict that the central bank will move to cut interest rates, which are already at historic lows. The ECB is also expected to signal that it will restart a bond buying program designed to spur economic growth.