TOKYO -- Japan posted 12 straight monthly balance-of-payments gains in June, taking the half-year surplus to its highest in five years as overseas income and tourism receipts prospered. June's current-account surplus was 558.6 billion yen ($4.5 billion), Ministry of Finance data showed Monday, compared with a median forecast of 773.6 billion yen. The gain was driven by a rising primary-income surplus, which measures profits from investment abroad, and a gain in the travel account due primarily to growth in tourist numbers on the back of the weak yen.

"The current account is returning to levels seen around the 2007-2008 Lehman crisis," said Yuichiro Nagai, economist at Barclays Securities Japan. "Drivers of growth in the current account have shifted from trade surplus to income gains and other areas such as a rise in the number of tourists."

In the first half of this year, the current-account surplus stood at 8.18 trillion yen, the largest since July-December in 2010, the ministry data showed.

Hefty returns from business and portfolio investment overseas brought a record primary-income surplus of 10.5 trillion yen in January-June this year, offsetting a trade deficit of 422 billion yen.

A record number of foreign tourists helped swing the travel account to a record surplus at 527 billion yen in the first half of 2015, the data showed.

The trade deficit narrowed sharply in January-June from a year before due to sharp drops in oil prices, which eased the burden of fuel imports to make up for the shutdown of nuclear power plants after the 2011 Fukushima crisis.

Slumping exports and tepid private consumption have led analysts to forecast an economic contraction in the second quarter, casting doubt on the Bank of Japan's optimism over trends in growth and prices.

In 2014, Japan's current-account surplus shrank for a fourth straight year to its smallest on record in a worrying sign the trade shortfall could deepen the balance-of-payments deficit — further complicating Tokyo's efforts to rein in a huge public debt.

The narrowing surplus raised concerns in some quarters that a persistent trade deficit may tip the current account into the red over the medium term, which could see Japan starting to chip away at its vast pool of domestic savings.

(Reporting by Tetsushi Kajimoto; Editing by Eric Meijer)