Economists had forecast exports to rise 14% and imports to climb 9% in May.
While exports have become a less-important growth driver for China in recent years as its domestic economy expands, the country remains the world's top exporter as well as its top commodity importer, so its trade data is closely watched as a barometer of global demand.
The surplus with the 28-nation European Union, China's biggest trading partner, expanded by 8 percent from a year earlier to $10.8 billion.
A brighter global outlook is supporting China's manufacturing machine, with the World Trade Organization saying it expects trade to "expand moderately" in the second quarter.
That raises hopes that exports may buffer the economy from a slowdown, as efforts at deleveraging and controls on real estate hit domestic demand, according to Tom.
An independent survey of factory activity indicated the manufacturing sector contracted in May for the first time in nearly a year, hinting at deteriorating conditions for producers in China.
ECB Drops Guidance on Rate Cuts in Step Toward Stimulus Exit
The dollar index, which measures the greenback against a basket of six major rivals, was last up 0.5 percent at 97.209. But since then sterling has been experiencing volatility as the markets await the results of the election.
In a sign of progress, the two countries agreed in May to take action by mid-July to increase access for USA financial firms and expanding trade in beef and chicken among other steps.
Among the economies participating in the Belt and Road Initiative, Kazakhstan is China's largest investment destination, Sun said at a news conference in Beijing.
China imported 37.2 million tonnes or 8.76 million barrels per day of crude oil last month, up 15 percent from a year earlier and almost 8 percent from April, data from the General Administration of Customs showed. Net exports of oil products jumped 50 percent from April to 1.51 million tons. This was unchanged from April's figure and higher than analysts predictions of 51.0.
That left the country with a trade surplus of US$40.81 billion for the month, the General Administration of Customs said.
For the first five months, coal shipments rose 30 percent from the year before to 111.7 million tonnes. The data were far better than the 7.2 percent rise in exports and the 8.3 percent increase in imports in dollar calculation, predicted by analysts in a survey by Bloomberg News.