According to a flash estimate by federal statistics agency Destatis, German gross domestic product (GDP) shrank by 0.2 percent in the period from April to June, following growth of 0.7 percent in the preceding three months.
Despite the economic contraction, analysts insisted that the recovery trend was not in jeopardy.
After a racing start too in the beginning of 2014, this quarter's is the first decline in German economic growth since the first three months of 2013.
Analysts had been forecasting zero growth or even a minimal contraction in the second quarter after the unusually mild winter boosted activity in the first three months of the year, notably in areas such as construction.
"The second-quarter setback reflects a combination of technical factors and external weakness, but not fundamental problems in the economy," said Berenberg Bank economist Christian Schulz.
"A relatively mild winter triggered a shallower than usual spring rebound in construction activity, while the timing of Easter holidays may have also shifted some production from the second quarter to the first quarter," he said.
"Put simply, the first-quarter figure probably overstated underlying growth a bit, while the second-quarter decline understates it."
Documents showed exports were also weak, not climbing as strongly as imports, with the result that the net contribution of foreign trade to GDP growth was negative in the second quarter.
Using a 12-month comparison, the German economy lost steam in the April-June period, with GDP expanding by 0.8 percent compared with a year earlier, Destatis said.
Domestic consumption continued to grow.