Japan's trade deficit ballooned in July as the cost of imports surged because of a cheaper yen and energy needs.

The Finance Ministry today reported a trade deficit of 1.02 trillion yen ($10 billion) for July, almost double a year earlier.

Exports jumped by 12% in the month while imports surged nearly 20%.

The dollar has risen in recent months against the yen, a plus for Japanese exports. But that also makes imports more expensive when translated into yen.

All but two of Japan's 50 nuclear plants have been turned off for safety checks after the March 2011 Fukushima nuclear disaster sent three reactors into meltdowns. That has meant Japan has imported much more oil and gas.

Japan, once known for giant trade surpluses, has posted trade deficits for 13 months in a row. Last month's trade deficit was the biggest ever for the month of July since comparable records began in 1979, the ministry said.

Weakening the yen is a key part of the Japan revival strategy of Prime Minister Shinzo Abe, who took office last year. Japan's economy, the world's third largest, has stagnated for the better part of two decades.

A weak currency is a boon for exports, and is lifting the earnings of some of Japan's best known companies such as Toyota.

But some analysts are questioning how long the momentum from a cheap yen will last without more fundamental reforms in Japan to counter a shrinking population and encourage competition and foreign investment.

Japan's economy grew a slower-than-expected 2.6% last quarter and the country's public debt surpassed the 1 quadrillion yen ($10.4 trillion) mark recently.