A plunge in Facebook shares weighed on US stocks, erasing more than 100 billion US dollars of the social media giant’s market value and ending a three-day winning streak for the S&P 500 index.

Facebook’s tumble led a sell-off in technology companies that offset solid gains in other areas of the market, including industrial and energy stocks and consumer goods companies.

Small-company stocks did better than the rest of the market.

The broader gains reflect another round of strong company earnings and fresh optimism among investors that trade tensions between the US and European Union may be on the mend.

“It’s a shock what happened to Facebook, but that little improvement in the trade picture and the continuation of the earnings results have just been spectacular,” said Ted Theodore, portfolio manager at TrimTabs Asset Management.

The S&P 500 index dropped 8.63 points, or 0.3%, to 2,837.44.

The Dow Jones Industrial Average climbed 112.97 points, or 0.4%, to 25,527.07.

The Nasdaq composite index lost 80.05 points, or 1%, to 7,852.18.

The Russell 2000 index of smaller-company stocks gained 10.16 points, or 0.6%, to 1,695.36.

More stocks rose than fell on the New York Stock Exchange.

Facebook China
Facebook’s problems weighed on the markets (Matt Rourke/PA)

The S&P 500, the market’s benchmark index, is still on track for its fourth weekly gain in a row.

Facebook sank 19% to 176.26 dollars after the social media giant said that its user base and revenue grew more slowly than expected in the second quarter, and that it expects slower revenue growth ahead.

The slower growth came about as the company grappled with privacy scandals.

All told, 119 billion dollars of its value was wiped out, more than the entire value of General Electric.

“For such a big company to suffer such a significant decrease in price is really amazing to watch,” said Erik Davidson, chief investment officer at Wells Fargo Private Bank.

Investors have been focused on the mostly favourable run of company quarterly earnings the past couple of weeks.

At the same time, traders have been wary of global trade tensions, which have ratcheted up in recent weeks as the US and some of its trading partners imposed tariffs and threatened more.

But talks held late on Wednesday between President Donald Trump and a European Union delegation gave markets cause for encouragement after both sides agreed to work on a pact to dismantle trade barriers.

Facebook was not the only big company to report disappointing quarterly results or outlooks.

Ford lost 6% to 9.89 dollars after the carmaker disclosed a sharp drop in quarterly profits and said it would undertake a restructuring that will cost 11 billion dollars over the next three to five years.

Mattel also slumped, dropping 4.2% to 15.61 dollars after the maker of Barbie and Hot Wheels reported a loss that was larger than analysts were expecting.

It also said it would eliminate more than 2,200 jobs.

Reports from other companies put investors in a buying mood.

D.R. Horton jumped 10.9% to 43.84 dollars after the homebuilder reported earnings and revenue that easily beat Wall Street’s forecasts. It also announced a 400 million dollar share repurchase programme.

Qualcomm vaulted 7% to 63.58 dollars after the chipmaker reported earnings that beat analysts’ expectations and said it would abandon a bid to acquire NXP.

Mondelez International, which sells Oreo biscuits and Cadbury chocolate, climbed 4.3% to 43.27 dollars after the company’s latest quarterly earnings and revenue topped analyst estimates.