Japan posted its first goods trade deficit in five months in January, logging red ink of ¥1.09 trillion ($9.7 billion) as imports increased more than exports on rising commodity prices, the government said Monday.

Imports marked their first gain in 25 months, up 8.5 percent from a year earlier to ¥6.51 trillion, while exports rose 1.3 percent to ¥5.42 trillion, the Finance Ministry said in a preliminary report.

Japan had a trade surplus of ¥399.31 billion with the United States, shrinking for a second straight month. Exports dropped 6.6 percent from a year earlier to ¥1.05 trillion and imports rose 11.9 percent to ¥654.66 billion.