Japan current account improves in May, outlook grim

A cargo ship berthes alongside a container wharf in the port of Tokyo, Japan on February 20, 2014.
Toshifumi Kitamura | AFP | Getty Images

Japan's current account logged a higher-than-expected surplus in May, government data showed on Tuesday, as the trade deficit narrowed due to a decline in imports.

But the improvement in the current account surplus could be temporary as export growth slowed in May, a sign that firms shifting manufacturing capacity overseas has made it difficult for exports to grow rapidly.

The current account data also highlighted the need to stimulate domestic demand and the services sector as exports are no longer enough to drive economic growth.

Read MoreFund managers settheir sights on unloved Japan

The surplus was 522.8 billion yen ($5.14 billion), more than the median forecast for a 403.6 billion yen surplus. It was the fourth consecutive month of surpluses, the finance ministry said.

In April, the surplus was 187.4 billion yen.

Japan's trade will likely remain in deficit: Pro

Exports rose 2.0 percent in May from a year ago, slower than a 6.2 percent annual gain in April.

Imports fell an annual 0.4 percent, following a 6.6 percent annual increase in April. As a result, the trade deficit in May narrowed to 675.9 billion yen.

Read MoreIs a less pacifist-Japan on collision with China?

The income surplus was 1.5 trillion yen in May, down 3.2 percent from the same period a year earlier, due to a decline in earnings from overseas subsidiaries of Japanese firms.

Analysts expect the economy to contract in the second quarter after an increase in the sales tax, with a Reuters poll conducted in June projecting a 1.2 percent quarterly drop.

The economy is expected to grow 0.6 percent in the current quarter, however, as consumer spending recovers from the tax hike and as government stimulus spending supports domestic demand.