Japan posted a current account deficit of ¥64.1 billion ($470 million) in October, its first red ink in nine months, as the yen's recent weakness and rising oil prices inflated import costs, the Finance Ministry said Thursday.

The current account balance, one of the widest gauges of international trade, turned red in the reporting month from a ¥1.73 trillion surplus a year earlier, marking the sharpest drop on record, according to the ministry's preliminary data.

The country's goods trade deficit stood at ¥1.88 trillion, after imports totaled ¥10.86 trillion, up 56.9% from a year earlier for the 21st straight month of increase.

The value of imports was pushed up by surging crude oil, liquefied natural gas and coal prices, driven by Russia's invasion of Ukraine.

The price of crude oil soared 79.4% from a year earlier in yen terms, according to the ministry.

Exports grew 26.9% to ¥8.99 trillion, up for the 20th consecutive month, led by shipments of automobiles and semiconductors.

By region, imports from Asia and the Middle East rose notably, while exports to Asia and North America expanded in particular, the ministry said.

The deficit in services trade, including travel and cargo transportation, expanded to ¥722.4 billion from a year earlier.

The travel balance, which reflects money spent on goods and services by foreign visitors to Japan against the amount Japanese spent overseas, posted a ¥43.0 billion surplus, up from ¥18.2 billion logged a year earlier.

With the easing of COVID-19 restrictions, Japan accepted 498,600 foreign visitors in October, while 349,600 Japanese nationals left the country in the month, according to data from the Japan National Tourism Organization.

Primary income, which reflects returns on overseas investments, posted a surplus of ¥2.83 trillion, up ¥451.5 billion on year, due to an expansion of direct investment revenue.