As supporters of Donald Trump stormed the US Capitol on January 6, battling police and forcing lawmakers into hiding, an insurrection of a different kind was taking place inside the world’s largest social media company.

Thousands of miles away, in California, Facebook engineers were racing to tweak internal controls to slow the spread of misinformation and inciteful content. Emergency actions — some of which were rolled back after the 2020 election — included banning Trump, freezing comments in groups with a record for hate speech, filtering out the “Stop the Steal” rallying cry and empowering content moderators to act more assertively by labeling the U.S. a “Temporary High Risk Location” for political violence.

At the same time, frustration inside Facebook erupted over what some saw as the company’s halting and often reversed response to rising extremism in the U.S.

Also read: Donald Trump effect: Stock of SPAC looking to merge with Trump Group soars

“Haven’t we had enough time to figure out how to manage discourse without enabling violence?” one employee wrote on an internal message board at the height of the Jan. 6 turmoil. “We’ve been fueling this fire for a long time and we shouldn’t be surprised it’s now out of control.”

It’s a question that still hangs over the company today, as Congress and regulators investigate Facebook’s part in the Jan. 6 riots.

The Associated Press reported that new internal documents provided by former Facebook employee-turned-whistleblower Frances Haugen provide a rare glimpse into how the company appears to have simply stumbled into the Jan. 6 riot. It quickly became clear that even after years under the microscope for insufficiently policing its platform, the social network had missed how riot participants spent weeks vowing — on Facebook itself — to stop Congress from certifying Joe Biden’s election victory.

Also read: New unnamed Facebook whistleblower accuses company of wrongdoing: Reports

The documents also appear to bolster Haugen’s claim that Facebook put its growth and profits ahead of public safety, opening the clearest window yet into how Facebook’s conflicting impulses — to safeguard its business and protect democracy — clashed in the days and weeks leading up to the attempted Jan. 6 coup.

This story is based in part on disclosures Haugen made to the Securities and Exchange Commission and provided to Congress in redacted form by Haugen’s legal counsel. The redacted versions received by Congress were obtained by a consortium of news organizations, including The Associated Press.

What Facebook called “Break the Glass” emergency measures put in place on Jan. 6 were essentially a toolkit of options designed to stem the spread of dangerous or violent content that the social network had first used in the run-up to the bitter 2020 election. As many as 22 of those measures were rolled back at some point after the election, according to an internal spreadsheet analyzing the company’s response.

“As soon as the election was over, they turned them back off or they changed the settings back to what they were before, to prioritize growth over safety,” Haugen said in an interview with “60 Minutes.”

Also read: US stocks edge lower, major indexes continue to hold stability

An internal Facebook report following Jan. 6, previously reported by BuzzFeed, faulted the company for having a “piecemeal” approach to the rapid growth of “Stop the Steal” pages, related misinformation sources, and violent and inciteful comments.

Facebook says the situation is more nuanced and that it carefully calibrates its controls to react quickly to spikes in hateful and violent content, as it did on Jan 6. The company said it’s not responsible for the actions of the rioters and that having stricter controls in place prior to that day wouldn’t have helped.

(With inputs from Associated Press)