Strong results from major companies including Microsoft, Visa and Comcast are sending U.S. stocks sharply higher Thursday. The rally wiped out most of the market’s plunge from the day before, but stocks are still down sharply over the past three weeks.

The S&P 500 index rose 2.3 percent as technology and consumer-focused stocks surged. The index plunged 9 percent since early this month as investors worried about climbing interest rates and the effects of the U.S-China trade dispute.

Rising rates and the trade dispute could both impair economic growth, and some encouraging economic news 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.

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 before.

The S&P 500 index added 49 points, or 1.9 percent, to 2,705 at closing time. The Dow Jones Industrial Average rose 400 points, or 1.6 percent, to 24,983. It was up 512 earlier.

The S&P 500 suffered two separate six-day losing streaks this month and had fallen for 13 out of the last 15 days. That stretch included a couple of big rallies, but the losses erased the benchmark index’s gains from earlier in the year. Technology companies have plunged, and the Nasdaq composite is coming off its biggest one-day loss in seven years.

The Nasdaq surged 209 points, or 3.0 percent, to 7,318. It had dropped 12.3 percent from its record high in late August.

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 third-most valuable U.S. company jumped 6.4 percent to $108.82.

Twitter soared 15.7 percent to $31.87 and electric car maker Tesla jumped 8.7 percent to $313.62 after releasing their quarterly reports, while video game maker Take-Two vaulted 9.1 percent to $121.05 after strong reviews for its latest game, “Red Dead Redemption 2.”

“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.

Warne said over the last couple of weeks, investors have dumped shares of companies that reported weak results, while companies that surpassed expectations aren’t getting 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.

Earnings for S&P 500 companies grew about 20 percent in the first and second quarters, and experts expect similar results for the third quarter.

On Thursday the stock market looks 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. But huge companies like Microsoft have slumped this month.

Two other giant U.S. companies, Amazon and Alphabet, will report their third-quarter results after the close of trading. Amazon is the second-most valuable U.S. stock and Alphabet is fourth.

Smaller and 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 36 points, or 2.5 percent, to 1,505. It’s fallen 13.5 percent since the end of August and is down 2 percent so far this year.

The French CAC 40 jumped 1.6 percent and Germany’s DAX added 1 percent. The British FTSE 100 rose 0.6 percent, although WPP, the world’s largest advertising company, said its business slowed in the third quarter and warned about weaker annual earnings. U.S.-traded shares of WPP fell 17.5 percent to $57.75.

Japan’s Nikkei 225 index swooned 3.7 percent and Hong Kong’s Hang Seng index ended 1 percent lower. The Kospi in South Korea dropped 1.6 percent. The heaviest losses came from technology companies including chipmakers Tokyo Electron and Taiwan Semiconductor Manufacturing and South Korea’s Samsung Electronics. Japanese telecoms and energy giant Softbank lost 4.4 percent.

U.S. bond prices edged lower. The yield on the 10-year Treasury note rose to 3.14 percent from 3.12 percent.

Benchmark U.S. crude rose 0.8 percent to $67.33 a barrel in New York. Brent crude, the benchmark for international oil prices, rose 0.9 percent to $76.89 a barrel in London.

Wholesale gasoline lost 0.5 percent to $1.81 a gallon. Heating oil added 1.2 percent to $2.28 a gallon and natural gas gained 1.1 percent to $3.20 per 1,000 cubic feet.

Gold rose 0.1 percent to $1,232.40 an ounce. Silver fell 0.3 percent to $14.63 an ounce. Copper dipped 0.1 percent to $2.75 a pound.

The dollar climbed to 112.59 yen from 112.44 yen. The euro fell to $1.1362 from $1.1387.

© The Associated Press. All rights reserved.