KOSPI and Kosdaq are displayed in the dealing room of Hana Bank in Seoul, Wednesday. The benchmark KOSPI closed at 6,579.04, up 3.68 percent from the previous session, while the secondary Kosdaq closed at 858.91, up 0.12 percent. Yonhap

The benchmark KOSPI surged 3.68 percent Wednesday, as foreign and institutional investors piled into large-cap semiconductor stocks on upbeat earnings from major U.S. tech companies and growing expectations for shareholder returns.

The benchmark KOSPI closed at 6,579.04, up 3.68 percent from the previous session. The index opened 1.42 percent higher and extended its gains, triggering a buy-side sidecar at 11:57 a.m., the 23rd such activation this year.

Foreign and institutional investors bought a net 2.83 trillion won ($1.9 billion) and 528.4 billion won worth of shares, respectively. Retail investors, however, sold a net 3.19 trillion won worth of shares, taking profits.

Investor sentiment toward large-cap semiconductor stocks improved following strong earnings reports from major U.S. tech companies, along with expectations for shareholder return plans. SK hynix rose 5.54 percent to close at 1,504,000 won, while Samsung Electronics gained 6.68 percent to finish at 255,500 won.