Oil prices have surged to nearly $140 a barrel recently
China has seen its trade surplus fall 10% in May from a year earlier after a surge in the cost of imported energy and other raw materials, figures show.
The trade surplus was $20.2bn (£10.3bn) compared with $22.45bn a year earlier, after imports rose by a more than expected 40% year-on-year to $100.3bn.
But exports also beat forecasts, showing how resilient the economy was despite a US slowdown, analysts said.
While China's surplus is tipped to slow, it is still seen remaining high.
"Robust export growth could dispel domestic concerns that a stronger yuan is hurting exports too much," said Gene Ma, head economist at China Economic Monitor.
Dwyfor Evans, an economist at fund management firm State Street, said: "We were expecting the export components to slow down marginally. But it doesn't look as though that is happening at all."
Imports of oil rose 25% in May compared with a year earlier, reversing a fall in April, with refiners seeking to ensure fuel supplies before the Olympic Games in August.
While May's surplus fell year-on-year it rose from $16.7bn in April.