Japan’s imports have fallen for the first time in more than two years as commodity prices softened, cushioning the impact from a global economic slowdown that is weighing on exports.

The value of imports decreased 2.3% from a year earlier in April, led by a decline in crude oil and liquid natural gas shipments, the Finance Ministry reported Thursday. The reading turned negative for the first time since January 2021, and was worse than analysts’ forecast of a 0.6% decline.

Exports were up 2.6% from a year ago, driven by car shipments, and was largely in line with analyst expectations. Together they shrank the nation’s ongoing trade deficit.