Japan’s trade surplus plunged 29 percent in May from a year earlier as imports outpaced exports, following a 10.3 percent surge the previous month.

An expansion in imported items, including crude oil and personal computers, overwhelmed big rises in exports of information-technology-related products, the Finance Ministry said Wednesday.

The politically sensitive trade surplus with the United States also fell, by 9.8 percent, following three straight months of year-on-year rise.

Because both imports and exports are on an upward trend, year-on-year changes in the monthly balance are difficult to predict for the time being.

The trade surplus — exports minus imports — came to 582.4 billion yen.

Exports to the U.S., Europe and other parts of Asia are brisk due to strong demand in these regions, while imports are being boosted by Japan’s recovering economy and higher oil prices.

Exports in May rose 8.2 percent to 3.85 trillion yen, the seventh consecutive month of year-on-year increase in a row. Semiconductors were the leading item amid the month’s export surge. Optical instruments and metal-processing machines, both of which support semiconductor production, also increased. Imports jumped 19.4 percent, also for the seventh consecutive month of increase, to 3.27 trillion yen. The average, yen-based oil price in the month was 44.5 percent higher than a year earlier, making oil the biggest contributor to the import expansion.

The yen averaged 107.32 to the dollar, up 12 percent. A stronger yen can be a factor making Japanese goods more expensive abroad and imports to Japan cheaper. In its trade with the U.S., exports edged up 1.7 percent to 1.13 trillion yen, for the fourth straight month of increase. Imports rose 11.7 percent to 663.5 billion yen, the first expansion in five months. The resulting trade surplus came to 467.7 billion yen.

The trade surplus with the rest of Asia surged 23.4 percent to 273.7 billion yen. Exports jumped 22.6 percent, mainly due to electronic parts. Imports, including personal computers and electronic parts, advanced 22.4 percent.

With the 15-member European Union, the trade surplus declined 14.4 percent, the second drop in two months, to 224.6 billion yen.

Exports slipped 0.8 percent as car exports plummeted because the euro’s weakening against the yen made them relatively expensive in the region, the official said. Imports rose 8.7 percent, helped by a surge in medical materials.