Japan welcomed a record 3.31 million visitors last month, official data showed Wednesday, as the weak yen propelled a tourism boom that is pouring money into the nation's coffers.

The number of foreign visitors for business and leisure rose from 2.87 million in September and exceeded the previous monthly record of 3.29 million set in July, data from the Japan National Tourism Organization (JNTO) showed.

In the year through October, about 30.2 million tourists arrived in Japan, just shy of the annual record of 31.9 million set in 2019 before the COVID-19 pandemic shut global borders.

Japan's famous autumn leaf colors contributed to increased tourism demand last month from many markets across Asia, Europe, and North America, the JNTO said. Through October, 11 countries and regions have surpassed annual records for numbers of visitors they send to Japan.

Travelers spent ¥5.86 trillion ($37.72 billion) in Japan through September of this year, preliminary figures showed last month. That eclipsed the ¥5.3 trillion they spent in all of 2023, a record for any 12-month period.

Tourism spending, classified as an export in national accounts, is poised to become Japan's second-biggest export sector after autos and ahead of electronic components.