(Bloomberg) -- Bets on artificial intelligence drove the largest quarterly foreign inflow to South Korean shares, contributing to a global rally in AI-related stocks.

Overseas investors bought a net $12.2 billion of local stocks in the first three months of 2024, a total that trails only Japan in Asia, according to Bloomberg-compiled data. Their favorites were the chipmakers active in the global AI supply chain — such as Samsung Electronics Co., which drew $4.1 billion, and SK Hynix Inc., which attracted $1.3 billion. 

Those wagers propelled foreign ownership of the benchmark Kospi to 34.42% as of March 28, the highest since the second quarter of 2021, according to data from the Korea Financial Investment Association.

There may be room for more inflows, Goldman Sachs Group analysts including Timothy Moe noted in a recent report. Kospi’s foreign ownership remained “light” as $50 billion of investment fled the country between 2020 and 2022, they wrote.

Given Korean equities’ recent run — Kospi gained 4% in March — investors may take profit in the coming weeks, Kyoung-Min Lee, an analyst at Daishin Securities Co. said. But global investors will likely continue to buy on an annual basis, he said. 

“Foreign investors are expected to keep buying Korean stocks in the cash market as there is momentum from the AI and rising visibility from the memory sector’s turnaround,” he said.

SK Hynix, the nation’s second-biggest chipmaker, recently forecast positive momentum in AI memory to extend into 2025. 

©2024 Bloomberg L.P.