The exports increased by 8.7% from a year earlier, whereas imports rose by 14.8%, surpassing analysts' expectations, reported an worldwide news agency.
China, the world's second-largest economy, had a global trade surplus of just over $40.8 billion last month, its Customs Office said Thursday, despite and impressive 14.8% year-on-year rise in imports that suggests solid domestic demand despite concern for slowing property prices. Stockpiles of imported iron ore at China's major ports remain close to 13-year highs. Shipments were forecast to climb 7.2% after gaining 8% in April. Imports gained 14.8 percent to $150.2 billion, up from the previous month's 11.9 percent.
The economist said exports growth is also likely to edge down further ahead, but should fare better than imports given the relatively upbeat outlook for China's main trading partners.
Exports have always been a principal driver of the Chinese economy.
In yuan terms, exports grew 15.5% and imports surged 22.1%, taking the trade surplus to CNY281.6 billion.
"The current strength of imports is unlikely to be sustained if, as we expect, slower credit growth feeds through into weaker economic activity in the coming quarters", Capital Economics' Julian Evans-Pritchard wrote in a note.
As a result, the trade surplus rose to USD40.8 billion from USD38 billion a month ago.
The key unknown is whether China would continue to boost infrastructure spending for the rest of the year.
Machinery, electronics and clothing exports rose in the first five months, while labor-intensive products such as fertilizer, steel and automobiles saw shrinking orders.
China's trade surplus with the USA was US$22.0 billion in May, up from US$21.34 billion in April, according to data from China's customs bureau.
Exports benefitted from solid demand from Europe and the United States, though trade has been under a cloud since Donald Trump was elected president in November vowing to shrink the large USA trade deficit with China.
China's latest trade data report provides some comfort for President Donald's Trump ambition to slash America's trade deficit with its biggest economic rival, but nonetheless shows how hard that will be - even with a more competitive greenback.
The surplus was below the expected level of USD47.8 billion.
That's the highest rate since November and comes despite a 27.1% surge in USA made imports.