Stocks soared Thursday as strong earnings reports from market bellwethers like Microsoft and Comcast gave a boost of confidence to investors shaken by the recent wave of selling.
The rally wiped out a large part of the market's plunge from the day before, but stocks are still down sharply over the past three weeks.
Technology companies rallied after reports from Microsoft and others, while Twitter and Comcast led the way for internet and media companies. Ford's results helped consumer-focused stocks.
Some encouraging economic news also helped stabilize markets. The Commerce Department said orders to U.S. factories for major manufactured goods grew in September, and the increase was larger than analysts expected.
The Standard & Poor's 500 index jumped 49.47 points, or 1.9 percent, to 2,705.57. The Dow Jones industrial average rose 401.13 points, or 1.6 percent, to 24,984.55, after rising as much as 520 points during the day. The NASDAQ surged 209.93 points, or 3 percent, to 7,318.34, after its biggest drop in seven years.
Stock trading turned volatile in October, with big sell-offs in the sectors that have powered the bulk of the gains during the market's long bull run. Even after Thursday's gains, the S&P 500 is down 7.5 percent since Oct. 3 as investors worried about climbing interest rates and the effects of the U.S-China trade dispute. The NASDAQ has plummeted 8.8 percent.
Investors are worried that rising interest rates and disputes with trading partners could hurt economic growth and corporate profits. They will get more insight into how the U.S. economy is doing early Friday when the government reports on economic growth during the third quarter. Experts think the country's gross domestic product grew 3.3 percent from July to September, according to FactSet.
Microsoft surpassed analysts' forecasts in the first quarter as it mined new revenue sources in online subscriptions, gaming and its LinkedIn professional networking service. Shares of the tech giant jumped 5.8 percent, to $108.30.
"It's certainly reassuring to see stocks bounce back today on stronger earnings, but I would expect that we continue to see a lot of day-to-day volatility," said Kate Warne, an investment strategist for Edward Jones.
Twitter soared 15.5 percent, to $31.80, and electric car maker Tesla jumped 9.1 percent, to $314.86, after their quarterly reports, while video game maker Take-Two vaulted 8.8 percent, to $120.70, after strong reviews for its latest game, "Red Dead Redemption 2."
The S&P 500 suffered two separate six-day losing streaks this month and had fallen for 13 out of the past 15 days. That stretch also included a couple of big rallies, but the losses erased the benchmark index's gains from earlier in the year. After Thursday's gains, the Dow and S&P 500 are each up about 1 percent for the year.
Earnings for S&P 500 companies have been growing at a clip of better than 20 percent this year, but much of that comes from last year's corporate tax cut, so it won't be repeated next year. While investors expect earnings to keep rising, they're not sure how much growth to expect, and that's contributed to the recent selling.
Those concerns could surface again as early as Friday. Investors didn't like what they heard from Amazon and Alphabet when they reported their results after the close of trading. The internet retailer dropped 9.1 percent in aftermarket trading while Google's parent company lost 4.8 percent.
Warne, of Edward Jones, said investors have been dumping shares of companies that reported weak results, while companies that surpassed expectations haven't been rewarded much. She expects that to change when the dust settles.
"When we get beyond earnings season and investors are wondering what now can drive the market higher or lower, knowing that we had a strong earnings season and companies did not lower their guidance very much will provide some support for stocks," she said.
On Thursday the stock market looked the way it has looked for most of this year: high-tech and consumer-focused companies lead the way while steadier, defensive stocks that pay big dividends weren't doing much, or lost ground.
Smaller, more U.S.-focused companies have also been sinking as Wall Street worries about future growth in the U.S. economy, which is tightly connected to their profits, as well as the possibility that rising interest rates will make it tougher for them to pay back their debts.
The Russell 2000 index gained 31.70 points, or 2.2 percent, to 1,500.40. It's fallen 13.8 percent since the end of August and is down 2.3 percent so far this year.
In Europe, European Central Bank President Mario Draghi said the region's economy is still growing at a solid clip even though there are signs it has weakened somewhat recently. But Asian markets took big losses, as the U.S. market did the day earlier.