Investors in the United States have mostly shrugged off the impact of the coronavirus ravaging China. That changed on Monday, when news of the outbreak’s spread drove them to sell stocks — at a furious pace.

The S&P 500 index, which had reached a record high as recently as Wednesday, fell 3.4 percent, its worst single-day performance since February 2018. As analysts issued new warnings that the outbreak could drag down economies around the globe, stocks fell enough to wipe out all of the index’s gains for 2020.

It was a turbulent day for stocks worldwide: European markets recorded their worst session since 2016, and major benchmarks in Asia also closed down.

“There was a cavalier attitude about the virus,” said Bruce Bittles, chief investment strategist at Baird, an investment banking and money-management firm. With the threats appearing to increase, he added, “you have to think about the global economy slipping enough to cause a shortfall in earnings.”