Japan posted a trade surplus for a second straight month in October, according to data released by the Finance Ministry on Monday. The surplus was driven by a continued decline in the value of imports, which have fallen faster than exports.

Exports fell 10.3 percent in October from a year earlier. The median estimate of economists surveyed by Bloomberg predicted an 8.5 percent decline.

Shipments have also dropped in every month for more than a year.

Imports decreased 16.5 percent during the same period, leaving a trade surplus of ¥496.2 billion.

Despite the drop in exports, trade continues to boost to Japan's recent growth. Net shipments, which subtracts imports from exports, added 0.5 percentage point to growth last quarter. The trade surplus is underpinned by drops in imports, with persistently weak energy prices causing imports to drop at double-digit rates for more than a year.

Exports were down due to drops in autos, steel and communications equipment, Yuichiro Nagai and Kyohei Morita of Barclays Securities Japan wrote in a note before the data were released.

"Considering seasonal factors, it's a pretty high trade surplus," said Tsutomu Saito, an economist at Daiwa Institute of Research, before the release. "Energy prices might pick up, but to compensate import volume is down, and export volume is increasing modestly."

Saito said U.S. President-elect Donald Trump could provide a short-term boost for trade, as the market is reacting favorably and his policies could increase domestic demand. Over the medium term, though, trade imbalances could become a problem, he added.