BEIJING, June 8 (Reuters) - China's May exports rose 8.7 percent from a year earlier, while imports expanded 14.8 percent, both beating analysts' expectations, official data showed on Thursday.
That left the country with a trade surplus of $40.81 billion for the month, the General Administration of Customs said.
Analysts polled by Reuters had expected May shipments from the world's largest exporter to have risen 7.0 percent, easing slightly from 8.0 percent growth in April.
Imports were expected to have climbed 8.5 percent, after rising 11.9 percent in April.
Analysts were expecting China's trade surplus to have widened to $46.32 billion in May from April's $38.05 billion.
Improving global demand has boosted exports for China and other trade-reliant Asian economies in recent months after several lean years of declining shipments, but investors have been more focused on its strong appetite for imports, particularly for industrial commodities such as iron ore and coal which is boosting resources prices worldwide. (Reporting by Sue-Lin Wong; Editing by Kim Coghill)