Facebook said Friday that hackers had stolen information that could have allowed them to take over 50 million user accounts -- the latest mishap for the social media company, which has spent months struggling to regain the confidence of policymakers and the public.

The company said that as many as 90 million Facebook users — out of a total of 2.2 billion — will have to log back into their accounts as a result of the breach. Notifications will appear at the top of the Facebook news feed for the 50 million users who were directly affected, executives said on a call with reporters.

The hackers were able to gain access to profile information, such as users' names, home towns and genders, Facebook said. They may have had access to more information, but Facebook said its investigation is in the early stages. No credit card information was exposed, Facebook executives said, and so far there is no evidence that the attackers sought to access private messages or post fraudulent messages from the accounts.

“This is a serious issue, and we’re committed to addressing it,” said Facebook chief executive Mark Zuckerberg. “This underscores that there are constant attacks from people who are trying to take over accounts or steal information from people in our community.”

Facebook said it discovered the breach Tuesday after noticing a spike in user activity on Sept. 16., which prompted engineers to investigate. They found three interlocking bugs on Facebook’s website that attackers had been using to gain access to accounts.

The attackers exploited Facebook’s systems through a flaw in the company’s “View As” feature, the company said, which allows a user to view his or her own profile as somebody else might see it.

Embedded in the “View As” feature was a video uploader that was incorrectly generating security tokens — pieces of code that, under normal circumstances, are designed to let a user remain logged in even after navigating away from Facebook’s website.

The Post's Geoffrey A. Fowler shows you how password managers are a much better (and more secure) way to manage your passwords on your favorite sites. (Jhaan Elker, Geoffrey Fowler/The Washington Post)

The incident prompted Facebook to disable the “View As” feature for the time being, and users are not being asked to change their passwords. The company has not determined who is responsible for the attack.

“People’s privacy and security is incredibly important, and we’re sorry this happened,” Facebook said in a blog post. “It’s why we’ve taken immediate action to secure these accounts and let users know what happened.”

The company said the security issue was patched Thursday night. Facebook’s stock dropped more than 3 percent after the news of the hack.

The disclosure adds to a brutal year for Facebook, which is still grappling with the fallout from its Cambridge Analytica fiasco and the prospect of new regulations or legislation in Washington that could target tech companies. Zuckerberg and his top lieutenants have been summoned repeatedly to Capitol Hill to answer for the social media company’s role in spreading misinformation and hate speech online.

Sen. Mark R. Warner (Va.), the top Democrat on the Senate Intelligence Committee, called the breach “deeply concerning” and called for a full investigation.

“This is another sobering indicator that Congress needs to step up and take action to protect the privacy and security of social media users,” Warner said. “As I’ve said before, the era of the Wild West in social media is over.”

On Wednesday lawmakers grilled representatives from Google, Twitter and a number of telecom companies on their approach to user privacy, in some cases demanding commitments to proposals such as a requirement that companies disclose data breaches within 72 hours of discovery. The companies largely balked at discussing specifics, instead pledging to work with the Senate Commerce Committee to craft a comprehensive national privacy law.

Meanwhile, tech companies such as Facebook are confronting growing scrutiny by state and federal law enforcement agencies, which are exploring whether to invoke antitrust law against some of the industry’s practices. The Federal Trade Commission has held hearings on the issue, and the Justice Department this week met with numerous state attorneys general to discuss Silicon Valley’s handling of user data.

The meeting opened the door to a possible multi-state probe into the tech industry, even as federal officials weigh whether they have the resources to mount an antitrust effort.

On Friday, the Justice Department’s antitrust chief, Makan Delrahim, said that he was receptive to complaints about tech companies but that regulators lack “credible evidence” to build an antitrust case. In the United States, antitrust lawsuits typically require regulators to marshal enough economic data to convince a judge that competition has been harmed by a company’s actions.

Facebook on Wednesday notified federal authorities as well as European data security officials of the security incident, but on Friday the company declined to say whether it has contacted other law enforcement agencies. British authorities said they would contact Facebook to determine whether British citizens were affected by the attack.

Ireland’s Data Protection Commission — the watchdog agency charged with monitoring compliance with GDPR, the European Union’s new data privacy law — said in a statement Friday that Facebook’s disclosure “lacks detail” and that it was pushing the company to reveal more as a “matter of urgency.” Violations of GDPR can carry enormous penalties: Up to 4 percent of a company’s annual revenue.