Facebook plunged to its worst loss in four years Monday and led a rout in technology companies. The social media company’s stock fell following reports that a data mining firm working for the Trump campaign improperly obtained data on 50 million Facebook users.

The drop in Facebook stock came after it was reported that the firm, Cambridge Analytica, was able to tap the profiles of more than 50 million Facebook users without their permission. Legislators in the US and Europe criticized Facebook and said they want more information about what happened. Investors wondered if companies like Facebook and Alphabet will face tighter regulation as a result.

Daniel Ives, chief strategy officer and head of technology research for GBH Insights, said Facebook is in a crisis, and it will have to work hard to reassure users, investors, and governments.

“This is a defining moment for them,” he said. “It either becomes a blip on the radar and it helps the platform mature… or it becomes the start of something broader.”

On the heels of the revelation, the S&P 500 index sank 39.09 points, or 1.4 percent, to 2,712.92. The benchmark index took its biggest loss since February 8, when it tumbled almost 4 percent as investors worried that rising inflation would slow the progress of the market and the US economy.

The Dow Jones industrial average fell 335.60 points, or 1.3 percent, to 24,610.91. During the day it fell as much as 493 points. The Nasdaq composite gave up 137.74 points, or 1.8 percent, to 7,344.24. The Russell 2000 index of smaller-company stocks declined 15.49 points, or 1 percent, to 1,570.56.

Larger technology companies including Apple and Microsoft fared worse than smaller ones. Another market favorite, Amazon, also dropped, and health care stocks fell more than the rest of the market.

Facebook said late Friday that it suspended Cambridge Analytica and its parent company. It said Cambridge obtained data from 270,000 people who downloaded a purported research app that was described as a personality test. A former employee said Cambridge was able to get data from tens of millions of other users who were friends with the people who downloaded that app.

Facebook first learned of the breach more than two years ago but hadn’t disclosed it. Facebook also said it recently received a report that Cambridge Analytica hadn’t deleted all of the data it obtained from Facebook, something Facebook said the company claimed to have done. Senator Amy Klobuchar of Minnesota said Facebook CEO Mark Zuckerberg should testify before the Senate Judiciary Committee while legislators in Britain and the European Union also called for inquiries.

On Monday Facebook said it hired an outside firm to audit Cambridge. Its stock sank $12.53, or 6.8 percent, to $172.56, its biggest one-day loss since March 2014.

Ives, of GBH, said Wall Street is more concerned about the latest situation than it was about issues like Facebook’s platform spreading fake news. That’s because Cambridge reportedly got access to the personal data of a large number of users, and the backlash suggests Facebook may face more regulation and could lose users, advertisers or advertising revenue.