BERLIN (Reuters) - Activity in Germany’s private sector rebounded in June after slowing for four months in a row, a survey showed on Friday, suggesting Europe’s largest economy had underlying strength despite losing steam on fears of restrictive trade policies.

Employees of German car manufacturer Porsche work on a Porsche 911 Carrera 4S at the Porsche factory in Stuttgart-Zuffenhausen, Germany, January 26, 2018. REUTERS/Ralph Orlowski

IHS Markit’s flash composite Purchasing Managers’ Index (PMI), which tracks the manufacturing and services sectors that account for more than two-thirds of the economy, rose to a two-month high reading of 54.2 in June from 53.4 in May.

An index measuring manufacturing activity fell to 55.9 from 56.9 in May, the lowest reading in 18 months. The index for services rose to 53.9 from 52.1 in May, a three-month high.

The figures reflected a cooling trend in the manufacturing sector that started this year after an all-time high reading in December 2017.

Economists have attributed this partly to the increasingly protectionist policies of U.S. President Donald Trump, which have clouded the outlook for Germany’s export-dependent manufacturers.

“The external environment has changed,” said Chris Williamson, chief business economist at IHS Markit. “What we are seeing now is a domestic demand-led upturn. Job numbers are very positive, companies are very eager to take on more workers.”

“Concerns are mainly about the manufacturing sector because of fears that trade disputes could turn into a fully blown trade war,” he added. “We still have not fallen off a cliff by any means. There is a slowdown happening here unless there is dramatic change to the external environment.”

He forecasts the economy to grow by 0.5 percent in the second quarter after an expansion of 0.3 percent in January-March.

Hard data published since the start of the year have pointed to a cooling trend in Germany.

In addition to weak industrial activity and exports in the first four months of the year, a trade dispute between the United States and the European Union is clouding the outlook for the economy.

U.S. President Donald Trump is threatening to impose hefty tariffs on car imports from European allies in addition to unilateral metals duties.

As well as the U.S.-EU trade dispute, German business leaders are worried that a trade confrontation between the United States and China could harm exporters that rely on the world’s two largest economies for growth.

“A worrying slide in export order growth seen since the start of the year continued into June, with the latest survey’s anecdotal evidence highlighting quieter client interest from the U.S. and China,” said Phil Smith, principal economist at IHS Markit.

“A clear divergence between manufacturing and services was also seen in the survey’s gauge of business confidence,” he added. “Services firms are in buoyant mood towards the outlook over the next 12 months, but manufacturers see growth continuing to cool and are their least optimistic for over three years.”