BERLIN — The German economy accelerated in the second quarter despite the U.S. move to impose new tariffs on Europe, official data showed, performing slightly better than economists had expected.

Germany's economy, Europe's biggest, grew by 0.5 percent compared with the previous three-month period. That is up from 0.4 percent in the first quarter — a figure that was revised upward Tuesday from the initial reading of 0.3 percent given in May. Economists had forecast a 0.4 percent increase this time.

Its performance in the April-June period was helped by higher private and government spending and by increased investment in equipment and construction, the Federal Statistical Office said. Rising exports were outpaced by increasing imports.

Volkswagen export cars
Volkswagen export cars are seen in the port of Emden, beside the VW plant, Germany, March 9, 2018. REUTERS/Fabian Bimmer

The figure underlined the German economy's continuing robust performance, with business confidence high and unemployment low despite some disappointing data on factory orders this year and concern about global trade tensions.

It has now grown for 34 of the past 37 quarters, said Carsten Brzeski, an economist at ING in Frankfurt, but he cautioned that "the challenges facing the German economy will increase rather than decrease."

Those include the specter of a possible escalation of trade tensions, despite a recent deal to defuse a U.S.-European Union dispute, geopolitical risks such as that posed by events in Turkey and a shortfall in investment and structural reforms at home, he said.

In year-on-year terms, the economy expanded by 2.3 percent in the second quarter.