By Kwanwoo Jun

South Korea's exports were powered by the unabated demand for advanced chips to fuel the global artificial-intelligence boom, resulting in their largest increase in nearly five decades.

The sharp rise in exports came days after the South Korean government--together with top memory-chip makers Samsung Electronics and SK Hynix--unveiled a massive investment plan to deepen the country's role in the global semiconductor supply chain and fend off competition from U.S. and Chinese rivals.

Exports surged 70.9% compared with the same period a year earlier to a monthly record of $102.25 billion--the fastest pace since October 1978--following a revised 53.4% increase in May, according to preliminary data released by the Ministry of Trade, Industry and Resources Wednesday.

That easily beat the median forecast for 57.3% growth from a Wall Street Journal survey of nine economists.

Imports expanded 30.1% to $66.10 billion in June, resulting in a trade surplus of $36.15 billion and surpassing the $30 billion threshold for the first time. In May the country's trade surplus was a revised $27.04 billion.

Semiconductors remained the main drivers of the overall shipment growth, the trade ministry said, with chip exports reaching a new monthly record of $44.82 billion in June.

Write to Kwanwoo Jun at kwanwoo.jun@wsj.com