Japan posted a 2.16 trillion yen ($15.5 billion) trade deficit in October, a record for the month, as imports surged to their largest amount on higher energy prices and the yen's sharp slide, far outpacing exports, Finance Ministry data showed Thursday.

Imports, which were at a historical record high, jumped 53.5 percent from a year earlier to 11.16 trillion yen led by crude oil, liquefied natural gas and coal. Exports gained 25.3 percent to 9.00 trillion yen after shipments of cars and electronics components increased, highlighting strong overseas demand.

Comparable data became available in 1979.

For the past six months, Japan has seen a record trade deficit for each month, as rising energy and raw material costs have dealt a blow to the resource-scarce nation. October marked the 15th straight month of red ink.

The yen's rapid weakening has magnified that impact, prompting Japan to intervene in the foreign exchange market by buying the yen for U.S. dollars to slow the Japanese currency's decline, likely on multiple occasions in October.

"The weaker yen boosted imports, and exports are falling in terms of volume. Japan's trade balance will likely remain deeply in the red for the coming months, though the deficit may become smaller," said Kota Suzuki, an economist at Daiwa Securities Co.

Higher auto exports to the United States helped Japan report a trade surplus of 720.36 billion yen. Both exports to and imports from the United States hit their highest levels for the month.

U.S.-bound exports climbed 36.5 percent to 1.78 trillion yen while imports advanced 47.1 percent to 1.06 trillion yen.

Increased imports of smartphones and personal computers led Japan to post a trade deficit of 671.35 billion yen with China, a major trading partner.

Imports from China jumped 39.3 percent to 2.39 trillion yen, which compares with exports that rose 7.7 percent to 1.72 trillion yen.

Japan's trade deficit came to 152.97 billion yen with the rest of Asia, including China, and 214.11 billion yen with the European Union.

The weaker yen has been eating into national wealth in recent months, with the nation's current account surplus in the six months to September shrinking to an eight-year low of 4.85 trillion yen, more than halving from a year earlier.

The value of imported crude oil per kiloliter gained 79.4 percent in October from a year earlier in yen terms, according to the ministry.

Daiwa Securities' Suzuki said the impact of the weaker yen on exports and imports will become "neutral," as the currency's rapid depreciation has temporarily halted and commodity prices, which had surged earlier, have stabilized. But he is cautious about the outlook for exports.

"Shipments to China are expected to decrease despite expectations that Beijing will end its zero-COVID policy because real estate troubles remain and there are concerns about economic slowdowns in the United State and Europe," Suzuki said.

Japan's economy unexpectedly contracted in the three months to September, weighed down by soaring import costs that count as a negative for gross domestic product, and slowing growth in consumption.

Aggressive monetary tightening in the United States and other advanced economies have raised concerns about slowing exports from Japan going forward, coinciding with worries about a slowing Chinese economy due to its zero-COVID policy and property woes.