South Korean stocks climbed, putting the benchmark index on track to enter a technical bull market, as a global rebound in the AI trade fueled a rapid reversal from last month’s historic rout.

The benchmark Kospi gained as much as 4.8% on Thursday, extending its gain from a July 30 low to around 22%. Heavyweight memory chipmakers Samsung Electronics Co. and SK Hynix Inc. drove the advance, each jumping more than 5%.

Enthusiasm for tech hardware stocks is returning on evidence of continued massive AI spending by global Big Tech firms in the latest results. The sentiment has sharply turned around from the past few months, when forced liquidations of leveraged chipmaker bets triggered trading halts and wiped out billions of dollars in retail wealth. Recent government curbs on single-stock leveraged ETFs and signs of investors reducing margin debt have helped stabilize the market.

“I think the market overshot to the downside during the unwinding of leveraged positions, and the current rebound is a natural one as flow stabilized,” said Kang DaeKwun, chief executive officer at Life Asset Management. “That said, I think it will be difficult for the market to sustain a continued rally until we see some stabilization in the AI narrative and US interest rates.”

A subdued US inflation report on Wednesday provided a fresh tailwind, as eased concerns about imminent interest-rate hikes by the Federal Reserve supported US-listed chip peers. Expectations that Samsung and SK Hynix will soon announce shareholder return plans have also lifted sentiment in recent sessions.

The Kospi is up more than 60% so far this year on a largely retail-driven rally, yet remains about 24% down from its late June peak. It tumbled 22% in July in its worst month since the global financial crisis.

Foreign investors remain sellers on a net basis, having withdrawn more than $100 billion from Korean shares this year as the market grew crowded and overheated. Some overseas funds have have started to come back, however, as the selloff drove valuations down to more attractive levels.

While the rising threat of competition from China had also thrown some cold water on the blistering surge in memory stocks, the near-term demand outlook remains intact. The spread of AI into new applications and greater everyday usage is fueling greater need for chips.

“Because of AI agents and physical AI, memory demand has exploded, but we entered into this with a quite limited supply capacity — that’s where the bottleneck is,” said Qian Zhang, emerging markets equities investment specialist at Baillie Gifford. “We’re not saying the world will be building data centers forever at this speed, but that is a real physical bottleneck that only a few companies in this world can resolve.”