Facebook said Wednesday that most of its 2 billion users likely have had their personal information scraped and shared by third-party developers without their explicit permission, dramatically raising the stakes in a privacy controversy that has dogged the company for weeks, spurred investigations in the United States and Europe and sent the company’s stock price tumbling.

The acknowledgment came in a Facebook blog post Wednesday afternoon in which the company for the first time detailed the scale of the improper data collection for Cambridge Analytica, a political data consultancy hired by President Donald Trump and other Republican candidates in the last two federal election cycles. The political consultancy gained access to Facebook information on up to 87 million users, most of them Americans, Facebook said. Cambridge Analytica obtained the data to build “psychographic” profiles that would help deliver target messages intended to shape voter behavior in a wide range of U.S. elections.

But in research sparked by revelations from a Cambridge Analytica whistleblower last month, Facebook determined that the problem of third-party collection of user data was far larger still and, with the company’s massive user base, likely affected a large cross-section of people in the developed world.

“Given the scale and sophistication of the activity we’ve seen, we believe most people on Facebook could have had their public profile scraped,” the company wrote in its blog post.

Facebook initially had sought to downplay the problem, saying in March only that 270,000 people had responded to a survey on an app created by the researcher in 2014. That data grab netted Cambridge Analytica the data on the friends of those who responded to the survey, without their permission. But Facebook declined to say at the time how many other users may have had their data collected in the process. The whistleblower, Christopher Wylie, a former researcher for the company, said that the real number of affected people was at least 50 million.

Facebook’s announcement, made near the bottom of a blog post Wednesday afternoon on plans to restrict access to data in the future, underscores the severity of a data mishap that appears to have affected almost one out of every four Americans and sparked widespread outrage at the carelessness of the company’s handling of information on its users. Personal data on users and their Facebook friends were easily and widely available to developers of apps before 2015. This included the names, hometowns, work and educational histories, religious affiliations and Facebook “likes” of users, among other data.

Facebook announced plans on Wednesday to add new restrictions to how outsiders can gain access to this data, the latest steps in a yearslong process by the company to improve its damaged reputation as a steward of the personal privacy of its users.

Developers who in the past could get access to people’s relationship status, calendar events, private Facebook posts and much more data, will now be cut off from access or be required to endure a much stricter process for obtaining the information.

Cambridge Analytica, which collected this information with the help of Cambridge University psychologist Aleksandr Kogan, was founded by a multimillion-dollar investment by hedge fund billionaire Robert Mercer and led by his daughter, Rebekah Mercer, who was the company’s president, according to documents provided by Wylie. Serving as vice president was conservative strategist Steve Bannon, who also was the head of Breitbart News. He has since left both jobs and also his post as top White House adviser to Trump.