China's exports gained speed in May, buoyed by strong demand ⁠for chips, autos and other high-tech goods fuelling the global artificial intelligence boom, giving policymakers some relief as energy price shocks from the Iran conflict weigh on broader demand.

A surge in ​global AI investment has helped the world's top manufacturer offset the ​export hit ⁠many had expected from the Middle East turmoil. But signs are emerging that stockpiling linked to higher energy costs is fading, with prices rising and overseas buyers starting to run down inventories as they wait for a cease-fire.

Exports expanded 19.4% from a year earlier in U.S. dollar value terms, customs data showed on Tuesday, outpacing the 14.1% gain in April and a 15% rise tipped by economists.

Imports notched another strong month, climbing 27.4% versus a rise of 25.3% a month prior. Economists had forecast growth of 25%.

"Chip price increases continue to support exports, with memory prices rising 20% month-on-month, pushing integrated circuit export growth to 111% for the month," said Xing Zhaopeng, ANZ's senior China strategist.