The benchmark Kospi index climbed to a record intraday high of 2453.17 in late July, which at that point was a more than 20 percent year-to-date rise. It gave up some of those gains after disappointing earnings from automakers, but then it took a bigger wallop after Trump ratcheted up the tensions earlier this week.

South Korea's stocks rallied to record highs last month and analysts turned increasingly bullish, but that may have just gotten derailed by the rising spat between President Donald Trump and North Korea's Kim Jong Un.

North Korean Leader Kim Jong Un looks on during the test-fire of inter-continental ballistic missile Hwasong-14 in this undated photo released by North Korea's Korean Central News Agency (KCNA) in Pyongyang, July, 4 2017.

The index is down more than 5 percent from the record high, and down around 3 percent this week.

On Tuesday, a Washington Post report, citing a confidential U.S. intelligence assessment, claimed the pariah state had successfully produced a miniaturized nuclear warhead that could fit inside its missiles.

The situation escalated after a blunt warning from Trump, which used language similar to the North's own frequent saber-rattling: If it were to make any more threats against the U.S., the president said, Pyongyang "will be met with fire, fury, and frankly, power, the likes of which this world has never seen before."

That spurred the North Korean army to almost immediately cross that line: It issued a statement carried by Pyongyang's state news agency that it was "carefully examining an operational plan" for targeting the U.S. island territory of Guam with "enveloping fire."

On Thursday, Trump ramped up the rhetoric, saying his comments may not have gone far enough.

But before the fresh tensions, the chorus of optimistic outlooks from analysts was fairly loud.

Daryl Liew, senior portfolio manager at Reyl Singapore, issued a report in early August calling South Korea's stock market "compelling," and one of the cheapest in Asia.

He noted that the MSCI Korea's forward price-to-earnings ratio was just 9.6 times, compared with the MSCI Asia ex-Japan at 14.4.

The portfolio manager for Reyl Group, which has more than 12 billion Swiss francs ($12.50 billion) under management, also pointed to signs of progress in reforming South Korean corporates under new President Moon Jae-in as a driver ahead.

Those were sentiments repeated in a Citi report on Monday — before the war of words erupted. Analyst Sean Lee said that while some of Moon's policies might hurt earnings of Kospi companies, they would be positive for stock valuations.

"Policies to support the low income bracket and SMEs could be negative for KOSPI earnings, but caring more about minority shareholders within a listed company could be positive for the improvement of corporate governance in Korea," Lee said, adding that better governance could re-rate the stocks higher.

To be sure, this would hardly be the first time that tensions have flared on the Korean peninsula, weighing on the stock market in the South.

Indeed, Goldman Sachs said in a note on Wednesday, "For decades, complacency has been the 'right trade' when it comes to North Korea. More often than not, market participants have been rewarded for fading negative price moves rather than hedging them."

It added that investors have "grown comfortable" with the tensions "invariably" leading to talks, making buying the dip the right trade.