Updated

Japan's trade deficit rose in July from the month before to a wider than expected 964 billion yen ($9.4 billion), though exports were higher for the first time in three months.

It was the 25th straight month of deficits for the world's third-largest economy, due mainly to an increase in imports of oil and gas to compensate for idled nuclear reactors following meltdowns at the Fukushima Dai-Ichi nuclear power plant in 2011.

Exports rose 3.9 percent from a year earlier to 6.19 trillion yen ($60.2 billion), slightly outpacing a 2.3 percent increase in imports, to 7.15 trillion yen ($69.5 billion). Japan recorded an 822 billion yen deficit in June.

Japan's demand for imports has moderated in recent months as business activity slowed following an increase in the national sales tax.