TOKYO, Aug 10 (Reuters) - Japan recorded a current account deficit in June ‌for the first time in 17 ‌months, data from the finance ministry showed on Monday, as ​robust investment in domestic markets from overseas investors boosted the size of dividend payouts.

The deficit in the current account stood at 92.3 billion yen ($584.51 ‌million) in June, ⁠versus economists' median forecast for a surplus of 1.51 trillion yen in ⁠a Reuters poll and against a surplus of 1.28 trillion yen a year earlier.

The net ​balance for ​primary income from securities ​and direct investment, ‌usually the biggest driver of Japan's current account surplus, shrank by 74% to 380 billion yen due to larger dividend payouts from Japanese companies to foreign investors.

Surging oil import costs also ‌led to a trade deficit ​in June and helped turn ​the current ​account into a deficit.

For the first ‌half of this year, however, ​Japan's current ​account surplus rose by 22.5% to a record 17.4 trillion yen, thanks to a ​trade surplus ‌driven by strong exports of semiconductors for ​AI dater centers.

(Reporting by Makiko ​YamazakiEditing by Shri Navaratnam)