The German economy shifted into a higher gear in the second quarter, defying the global economic and political uncertainty triggered by trade tensions and US President Donald Trump’s America First drive.

Europe’s biggest economy expanded by a stronger-than-forecast 0.5 per cent quarter-on-quarter in the three months ended June, powered ahead by domestic demand, data released on Tuesday by the Federal Statistics Office (Destatis) showed. Analysts had expected a 0.4-per-cent rise in the second quarter.

“Germany remains on track for a golden decade,” said ING Bank economist Carsten Brzeski, noting that the economy has grown in 34 out of the last 37 quarters.

Releasing the data, Destatis also revised up its original estimate for gross domestic product (GDP) in the first three months from 0.3 to 0.4 per cent.

“The German economy continues on a growth path,” Destatis said releasing the data, with second-quarter GDP boosted by “positive impulses” from the nation’s domestic economy, including increases in both household and state spending. Businesses also stepped up their investments in equipment.

However, trade is likely to have acted as a drag on GDP with the rise in imports outpacing exports, according to the data.

Destatis releases a detailed breakdown of the second-quarter GDP later this month.

The better-than-expected growth in Germany came despite a recent batch of weak manufacturing data, which had raised concerns that the global trade war launched by Trump under his America First protectionist banner was weighing on the German economy.

While business confidence also dropped in July to its lowest level since March last year, consumers grew less optimistic on the back of worries about the outlook for the nation’s economy.

However, the Centre for European Economic Research (ZEW) is forecast to say later Tuesday that its closely watched German investor confidence survey rose in August after slumping to its lowest level in nearly six years in July.

Tuesday’s data showed German GDP expanding by 2 per cent in the second quarter compared with the same period a year earlier. Year-on-year GDP stood at 2.1 per cent in the first quarter.

In the slew of data released by Destatis, the statistical office also said that employment in Germany chalked up another rise in second quarter, growing by 1.4 per cent to 44.8 million compared with the same period a year earlier.

Annual inflation in Germany slipped back 2 per cent in July from 2 per cent plus in both June and May, Destatis said confirming earlier figures.