Taiwan's June exports gained 0.5% from a year earlier, the first growth since October, finance ministry data showed on Monday. The exports hit $28.39 billion, a record for June.

A Reuters poll had forecast a 4% fall. In May, the trade-reliant economy's exports contracted 4.8% from a year earlier.

Finance Ministry official Beatrice Tsai told reporters the better-than-expected June growth was boosted by "returning production" from Taiwan manufacturers who moved parts of their supply chain to the island, as well as an increasing demand for semiconductor products.

"The return to growth of exports was earlier than expected, mainly thanks to manufacturers who have been moving their production back to Taiwan since last year," said Yuanta Securities economist Woods Chen.

"We expect exports to remain on the positive side in the second half, although the growth would be minor," Chen said.

ING said the export growth is positive but "it is too early to celebrate", adding that "we doubt that the moving of factories from Mainland China to Taiwan will change the landscape for trade."

A growing number of Taiwan manufacturers, including computer-maker Compal Electronics, are moving to shift production from China to other factories in the region because of U.S. President Donald Trump's tariffs on Chinese imports.

Taiwan's factories are a key part of the global supply chain for tech giants such as Apple Inc.

In June, Taiwan's exports to the United States rose 18.5% on the year, helped by double-digit yearly growth from telecom and machinery products.

Shipments to China fell 3.8%, while exports to Europe fell 8.6%.

The finance ministry expects exports in July to be in the range between 1% growth and 1% contraction.

KGI Securities economist Carl Liu said the growth in June was boosted by a surge of telecom orders from the United States, but he cautioned that the ongoing trade friction remains the "biggest uncertainty" for Taiwan's exports.

Last month, Taiwan's central bank again cut its 2019 economic growth forecast, citing a slowing global economy and trade war uncertainties.

(Reporting by Yimou Lee, Jeanny Kao and Roger Tung; Editing by Richard Borsuk)