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.
Exports expanded 19.4 per cent from a year earlier in US dollar value terms, customs data showed, outpacing the 14.1 per cent gain in April and a 15 per cent rise tipped by economists.
Imports notched another strong month, climbing 27.4 per cent versus a rise of 25.3 per cent a month prior. Economists had forecast growth of 25 per cent.
"Chip price increases continue to support exports, with memory prices rising 20 per cent month-on-month, pushing integrated circuit export growth to 111 per cent for the month," said Xing Zhaopeng, ANZ's senior China strategist.
China's exports of automated data processing equipment soared 66.1 per cent in value terms year-on-year, high-tech products rose 50.9 per cent and shipment of cars jumped 39 per cent, the data showed.
"Looking ahead, the AI story is far from over -- chips are rewriting China's trade landscape," Xing added.
The AI boom has driven strong demand for semiconductors powering data centres and advanced electronics, playing to China's manufacturing strengths. But early signs suggest that momentum may be starting to fade.
Separate factory activity data for May showed a steep drop in new export orders from April's two-year peak, when warehouse managers reported "booming" business amid a scramble by foreign factories to lock in supplies.
Strong exports powered China's $US20 trillion economy past forecasts in the first quarter, but signs of cooling momentum have reinforced concerns that fragile domestic demand leaves it exposed to weaker global conditions and increases the likelihood of further policy support.
Beijing is under growing international pressure to strengthen domestic consumption, as critics warn its heavy reliance on imported inputs and re-exports is distorting trade and squeezing other emerging economies out of higher-value manufacturing.
The Organisation for Economic Cooperation and Development amplified that concern last week, noting in a report that nearly 60 per cent of Chinese firms' "market share gains can be explained by subsidies received."
A new US Federal Reserve paper found China's trade surplus - measured against global GDP - has topped one per cent, well above the peaks Japan and Germany hit in the late 20th century, and shows little sign of narrowing. That suggests persistent Chinese industrial overcapacity will reshape global manufacturing for years.
A closely watched meeting last month between US President Donald Trump and President Xi Jinping helped cool tensions but produced no meaningful breakthroughs, whether on tariff disputes or cooperation over ending the Iran conflict.
China's trade surplus came in at $US105.43 billion in May, up from $US84.8 billion a month prior and from a forecast of $US92.1 billion.