Japan's trade deficit for May expanded 9.5 percent from a year earlier to $10.4 billion, official data showed Wednesday as import costs rose on a weak yen.
Data from the finance ministry showed Japan incurred a trade deficit of 993.9 billion yen, the 11th straight monthly shortfall.
That was the longest run of monthly deficits since a 14-month string from July 1979 to August 1980.
But May's deficit was smaller than expected as the market had forecast a shortfall of around 1.2 trillion yen.
Exports rose 10.1 percent to 5.76 trillion yen, growing for the third straight month on higher shipments to the United States and China.
Imports also climbed 10.0 percent, an increase for the seventh consecutive month, as costs of fuel and other items jumped due to a weaker yen.
A lower yen helps make Japanese exporters more competitive overseas but pushes up import bills.
Japan's fuel imports have soared as most of its nuclear reactors remain off-line since the huge earthquake and tsunami in 2011 sparked the world's worst atomic accident in a generation.