Major U.S. stock indexes gave up early gains and closed mostly lower Wednesday, extending the market’s heavy losses for the week.

The benchmark S&P 500 fell for the fifth straight day after swinging between a 0.6% loss and 1.7% gain. Smaller company stocks bore the brunt of the selling. The bond market continued to flash warning signs as long-term Treasury yields fell further below short-term yields.

Worry about economic fallout from the virus outbreak that originated in China has fueled a sharp sell-off this week that’s wiped out the market’s gains for the year.

The virus continues to spread and threatens to hurt industrial production, consumer spending, and travel. More cases are being reported in Europe and the Middle East. Health officials in the U.S. have been warning Americans to prepare for the virus.

“The market is still digesting the full impact of what the coronavirus could mean for global GDP growth and, more importantly, on earnings growth for a lot of companies,” said Nadia Lovell, U.S. equity strategist at J.P. Morgan Private Bank.

The S&P 500 index fell 0.4%. It’s on track for its biggest monthly decline since May. The Dow Jones Industrial Average dropped 123.77 points, for a three-day loss of 2,034 points. A modest rally in technology stocks helped nudge the Nasdaq composite to a 0.2% gain.

Smaller company stocks fell the most. The Russell 2000 index lost 1.2%.