BERLIN (Reuters) - Strong German exports to the United States helped Europe’s largest economy to avoid a recession in the third quarter, data showed on Thursday, as companies benefited from a weaker euro and trade diversion linked to the U.S.-China tariff dispute.

FILE PHOTO: Aerial view of containers at a loading terminal in the port of Hamburg, Germany August 1, 2018. REUTERS/Fabian Bimmer/File Photo

The detailed trade figures, compiled for Reuters from the Federal Statistics Office, underline that U.S. demand for German goods remains strong, undaunted by President Donald Trump’s threats to increase import tariffs on European cars.

Germany’s export-reliant economy avoided slipping into recession in the third quarter as consumers, state spending and construction drove a 0.1% quarterly expansion. Exports also fared better than in the previous three months.

Overall, exports grew 1.7% year-on-year in the third quarter after a 1.3% decline in the second. The U.S. and France remained Germany’s two biggest customers, the data showed.

German exports to the U.S. grew 7.6% year-on-year in the third quarter after a 5.3% increase in the previous three months. Exports to France rose 3.1% year-on-year after stagnating in the second quarter.

“Europe is benefiting from still being the uninvolved third party in the American-Chinese trade conflict. This leads to trade diversion and helps European exporters,” Jens Suedekum from the Heinrich-Heine-University in Duesseldorf told Reuters.

Unexpected help for German exporters also came from France, where the economy is doing well thanks to structural reforms and fiscal stimulus measures enacted by President Emmanuel Macron.

“This spilled over to German exporters,” Suedekum said. “Chancellor Angela Merkel should send a thank-you note to Paris.”

French demand was especially strong for German machinery, cars and airplanes, the data showed. U.S. companies imported more machinery and pharmaceutical products.

Slideshow ( 2 images )

SIDE EFFECTS

Gabriel Felbermayr, president of the Kiel Institute for the World Economy, pointed out that the euro had depreciated by 14% against the U.S. dollar since the beginning of 2018. A weaker euro makes German exports less expensive.

“The strong dollar is one of the macroeconomic side effects of Trump’s trade policy toward China. It leads to trade diversion,” Felbermayr told Reuters. That means the U.S. is increasingly buying goods from the European Union and Germany as tariffs make competing imports from China more expensive.

The United States and China are locked in a trade war triggered by Trump. Both countries have levied punitive duties on hundreds of billions of dollars worth of each other’s goods, roiling financial markets and threatening global growth.

But Felbermayr cautioned that the uncertainty created by Trump’s ‘America First’ trade policy in the medium term will lead to stronger production of German companies in the United States, which will weaken exports.

“The relocation of jobs is already taking place but is not yet visible in the export figures,” he said.

This cautious tone was echoed on Thursday by the finance ministry. It said in a monthly report that exports stabilized at the end of the third quarter, but a slowing world economy and persistent trade risks pointed to only moderate developments in the coming months.

The strong demand for German’ goods from the United States and France helped to cushion Germany from an unusual slowdown in exports to China, which was a steady source of growth for German manufacturers for nearly three decades.

German exports to the world’s second-largest economy edged up only 0.3% year-on-year in the third quarter. By comparison, exports to China grew 1.8% in the second quarter and 6.3% in the first.

That suggests Germany can no longer rely on Chinese demand to fuel its export machine and with it, well-paid manufacturing jobs and tax revenues at home.

“Rising protectionism, the U.S. trade conflicts with Europe and China and the still-unclear Brexit situation are unsettling companies worldwide so they are holding back investments,” said Volker Treier from the DIHK Chambers of Industry and Commerce.

The subdued trade outlook means that exports are expected to shrink by 0.5% next year, Treier said. That would be the first decline in German exports since the global financial crisis over a decade ago.