The German economy unexpectedly rebounded in the third quarter as the trade war between America and China lost some of its intensity, assuaging fears of a recession that could drag down the rest of the eurozone.

Gross domestic product in Germany, Europe’s largest economy, grew 0.1 percent from the second quarter, when output had fallen 0.2 percent from the previous quarter, according to official data released Thursday.

While growth in the quarter was hardly torrid, many economists had expected worse. A second consecutive quarter of declining output would have met a common definition of recession.

Strong consumer spending and construction, bolstered by low unemployment and cheap credit, more than offset a decline in industrial production, Germany’s Federal Statistics Office said Thursday.