South Korea posted stronger export growth in May due to more working days, but ran a trade deficit for a second straight month as China’s pandemic lockdowns, the war in Ukraine and higher prices of commodities weighed on global commerce.

Overseas shipments grew 21.3% from a year earlier to $61.52 billion, following April’s revised 12.9% increase, according to preliminary data from the trade ministry on Wednesday. That beat market expectations for a 19.6% rise.

Demand for semiconductors, petrochemicals, steel and other Korean goods was strong, with exports to the U.S., the E.U. and other major global markets remaining solid, the ministry said.

Analysts said the country’s trade data looked better because there were two more working days in May this year.

Imports jumped 32.0% to $63.22 billion after a 18.6% rise in April on surging energy prices, resulting in a trade deficit of $1.71 billion in May compared with a revised $2.51 deficit a month ago.

Higher prices of oil, grain and other prices amid the war in Ukraine and global supply-chain disruptions kept boosting the value of imports, analysts said.