The price of bitcoin and other digital currencies rose on Thursday, with bitcoin hovering near record levels and extending a healthy year-to-date advance.

The climb in the asset class came on one of the weakest days for U.S. stocks in recent trading. The S&P 500 index fell 1%, on track for its biggest one-day decline since mid May amid tensions between the U.S. and North Korea. In the past, political or economic uncertainty has contributed to gains in bitcoin and other cryptocurrencies, with investors using them as a diversification tool as they have little correlation to other asset classes.