NEW YORK (AP) — Stocks are climbing for the second day in a row Wednesday at the end of a brutal month for the market. Investors are applauding strong quarterly results from companies including Facebook, General Motors and Estee Lauder. Markets also rose in Europe and Asia.

The S&P 500 is on track for its first two-day gain since late September. The index is still down 6.2 percent in October and is headed for its worst monthly loss since August 2015. Technology companies, retailers, industrial and energy companies have all plunged as investors worried about rising interest rates and the U.S.-China trade dispute.

KEEPING SCORE: The S&P 500 index rose 49 points, or 1.8 percent, to 2,732 as of 3:10 p.m. Eastern time. The Dow Jones Industrial Average gained 421 points, or 1.7 percent, to 25,297. The Nasdaq composite jumped 188 points, or 2.6 percent, to 7,350. The Russell 2000 index of smaller companies picked up 14 points, or 1 percent, to 1,521.

The plunge in October wiped out a big rally over the previous three months. The last winning streak for the S&P 500 was a three-day string of gains that ended on Sept. 20, the day of its latest record high. That was 28 trading days ago. According to Ryan Detrick of LPL Financial, that's one of the longest gaps since the Great Depression: the S&P 500 also went 28 days without a winning streak in 1970, 1994 and 2015.

FACEBOOK FACE LIFT: Facebook had a mixed third quarter, with better-than-expected earnings and disappointing revenue. But after the company's recent losses, even that was a relief to Wall Street. After a 2.9 percent gain Tuesday, the stock rose 4.3 percent to $152.53.

Facebook has plummeted 30 percent since reaching a record high in late July. That same month, Facebook reported weaker-than-expected user growth and said it's spending more on security, moderation and product development.

Investors worry that companies like Facebook will be subject to more regulation following several data privacy scandals as well as online election meddling from outside the U.S. Facebook is also facing harsh criticism that its platform is being used to inflame ethnic and religious conflict in Myanmar. On top of all that, high-tech stocks like Facebook have stumbled this month as investors looked for safer, steadier options.

Other high-flying internet and tech stocks did better than Facebook. Netflix jumped 6.7 percent to $305 and Amazon soared 5.2 percent to $1,609. Elsewhere, Apple gained 3.1 percent to $219.91.

Those stocks have taken enormous losses this month. Amazon has fallen 20 percent, wiping out around $200 billion in market value. The tech-heavy Nasdaq has skidded 8.6 percent, and it's on track for its worst month since November 2008.

PUT IT IN DRIVE: General Motors did far better than expected in the third quarter as it raised prices in North America and its China division held up well. The company also moved to cut costs by offering buyouts to about 18,000 white-collar employees in North America. The stock jumped 10.3 percent to $36.99.

THE QUOTE: Marina Severinovsky, an investment strategist at Schroders, said several different factors could help stocks over the next few weeks, including an increase in corporate stock repurchases and signs of progress in U.S.-China trade talks.

"If there's any kind of movement, even a stay of execution, could be a positive for the market," she said. Severinovsky added that whatever the outcome of next week's midterm elections, stocks will probably rise once they are over.

"Markets tend to rally on certainty," she said.

BONDS: Bond prices dropped. The yield on the 10-year Treasury note rose to 3.15 percent from 3.11 percent.

OVERSEAS: The French CAC 40 surged 2.3 percent as aircraft maker Airbus and cosmetics maker L'Oreal's both jumped. Germany's DAX gained 1.4 percent and Britain's FTSE 100 added 1.3 percent.

Japan's Nikkei 225 index jumped 2.2 percent and Hong Kong's Hang Seng rose 1.6 percent. The Kospi in South Korea gained 0.7 percent.

Stock indexes overseas also tumbled in October. The DAX sank 6.5 percent and the Hang Seng dropped 10.1 percent. Mexico's Bolsa tumbled 11.8 percent and the Kospi plunged 13.4 percent. U.S. stocks had done far better than all of those indexes this year,

"The U.S. was showing extraordinary outperformance to the rest of the world and it wasn't necessarily justifiable," said Severinovsky.

SPOOKY, SCARY: Stocks have plunged this month as Wall Street was frightened by numerous potential problems including interest rates and trade tensions. Both could impair economic growth and company profits. Investors are that much more nervous because corporate profit growth is already expected to slow in 2019 after it jumped this year, a big portion of which stemmed from the one-time corporate tax cut.

METALS: Gold lost 0.8 percent to $1,215 an ounce. Silver fell 1.2 percent to $14.28 an ounce. Copper slipped 0.2 percent to $2.66 a pound.

ENERGY: Benchmark U.S. crude fell 1.3 percent to $65.31 per barrel in New York. Brent crude, used to price international oils, shed 0.6 percent to $75.47 per barrel in London.

Energy companies have lagged the market as U.S. crude has fallen 10 percent this month.

Wholesale gasoline lost 2.1 percent to $1.77 a gallon. Heating oil edged up 0.1 percent to $2.26 a gallon. Natural gas rose 2.3 percent to $3.26 per 1,000 cubic feet.

CURRENCIES: The dollar slipped to 113.06 yen from 112.96 yen. The euro fell to $1.1314 from $1.1342.