NEW YORK – Wall Street received a painful reminder that the coronavirus pandemic isn't going away, and a big early gain for stocks suddenly flipped to losses after California showed how it's still scarring the economy.

The S&P 500 fell 0.9%, with all the losses accumulating in the last hour of trading, after California said it will extend closures of bars and indoor dining across the state, among other restrictions. It's one of many states across the U.S. West and South where coronavirus counts are accelerating and threatening the budding recovery that just got underway for the economy.

The announcement from California, which accounts for 15% of the country's economy, combined with an escalation by the White House in its tensions with China to knock the market down from its earlier gain of 1.6%.

Technology stocks took the hardest losses, highlighted by Microsoft's swing from an early gain of 1% to a loss of 3.1%. It's a sharp step back for tech-oriented giants, which have been cruising higher through the pandemic on bets that they can keep growing almost regardless of the economy.

"There's an increasing sense that the recovery from the virus-related shutdown is going to be more drawn out, more uneven than maybe the market was looking for," said Willie Delwiche, investment strategist at Baird. "And you add on top of that a number of tech companies that had run up tremendously over the past couple of weeks, so there's a little bit of shaking out there as well."

The tech losses helped drag the Nasdaq composite down 226.60 points, or 2.1%, to 10,390.84. The Dow Jones industrial average squeaked out a gain of 10.50 points, or less than 0.1%, to 26,085.80. The S&P 500 dropped 29.82 to 3,155.22.

In a signal of downgrading expectations for the economy, Treasury yields fell and smaller stocks did worse than their larger rivals. The Russell 2000 index of small-cap stocks lost 1.3%.

The volatility struck markets just as earnings reporting season gets underway.

Several of the country's biggest banks are slated to report their results Tuesday, including JPMorgan Chase, and the expectations are almost universally dreadful across the S&P 500.

Analysts said the biggest U.S. companies likely saw their earnings per share plummet nearly 45% from April through June, compared with year-ago levels. That would be the sharpest drop since the depths of the Great Recession in 2008, according to FactSet.

Investors are expecting banks, which traditionally kick off each earnings season every three months, to say they have had to set aside billions of dollars to cover loans potentially going bad due to the pandemic-caused recession, for example.

For energy stocks, whose earnings reports get going later in July, Wall Street expects profits to have disappeared completely. It's not surprising given how prices in one corner of the U.S. oil market dipped below zero during the quarter as demand disappeared.

Investors have largely seemed willing to give a pass for such terrible results in the latest quarter and maybe even for a couple more. Instead, investors are focusing on a hopeful return to profit growth in 2021 and beyond. That's helped the S&P 500 climb back to within 7% of its record set in February.

The hope is that the economy and declines in corporate profits bottomed out in the spring and will continue to improve.