Japan's trade surplus shrank 28.8 percent in October from a year earlier to 822.1 billion yen, marking a seventh straight month of decline, the Finance Ministry said Thursday.

Although exports rose 8 percent to 5.91 trillion yen, up for a 23rd straight month, imports climbed by 17.8 percent to 5.088 trillion yen, thanks mainly to soaring oil prices, the ministry said in a preliminary report.

Imports thus increased for a 20th consecutive month.

Both categories marked their second-highest readings on record, mirroring Japan's brisk trade with the U.S. and other Asian economies.

Imports of crude oil jumped 49.5 percent in value terms amid record high crude oil prices in October, which stood at $59.9 per barrel on a customs-cleared basis, up 50 percent from a year earlier.

Private sector economists said the strength of exports, recent falls in crude oil prices and the yen's depreciation will likely help reverse the shrinking trade surplus trend in the coming months.

"We expect the trade balance to stabilize going forward," said John Richards, head of research at Barclays Capital Japan Ltd.

"Exports have clearly recovered, helped in part by recent weakness in the yen and a pickup in exports to China in broad sectors. And import growth will slow as energy prices level off and possibly fall."

According to the report, Japan's trade surplus with the rest of Asia decreased 11.2 percent to 609.9 billion yen, with exports up 8 percent to 2.8311 trillion yen and imports up 14.8 percent to 2.221 trillion yen.

Japan posted a 218.5 billion yen trade deficit with China, excluding Hong Kong, up 29.2 percent from a year earlier.

Exports to China grew 12.8 percent to 831.9 billion yen, the highest level on record. Exports of steel, especially for ship-building, rose 20 percent.