London (CNN Business) Germany's economy shrank in the second quarter as global uncertainty and the trade war took a toll on its manufacturers.

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.

The world's fourth largest economy, and Europe's biggest, has been hit by what analysts have described as a "perfect storm" of negative factors.

Germany relies heavily on exporters that sell a large amount of goods to China and the United States, which are locked in a bitter trade dispute. Weak global auto sales have also hit the country's carmakers, and fears of a disorderly Brexit remain a drag.

Read More