Facebook Inc. said hackers gained access to nearly 50 million accounts in what amounts to the largest-ever security breach at the social network at a time when it is working to regain the trust of its more than 2 billion users.

The company said Friday it didn’t know who was behind the attack, which was discovered earlier this week. Hackers could have gained access to the accounts as early as July 2017, the company said.

Chief...

RELATED VIDEO

Data-Security Concerns Threaten Trust in Tech Companies

Tech-company executives at The Wall Street Journal's D.Live conference in Hong Kong responded to concerns over data security in the wake of Facebook's privacy scandal. (Originally published April 20, 2018)