Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Senior executives from Facebook and Twitter offered apologies and promises on Wednesday as senators questioned why the companies were slow to respond to foreign influence campaigns on their platforms.

The hearing, the fourth by the Senate Intelligence Committee on the topic of social media and state-based manipulation, featured the testimony of Twitter CEO Jack Dorsey and Facebook chief operating officer Sheryl Sandberg.

“We were too slow to spot this,” Sandberg said in her opening statement, referring to Russian efforts to spread divisive propaganda and misinformation during the 2016 presidential election and in other elections of the U.S. and its allies. “And we were too slow to act. And that is on us.”

Both Sandberg and Dorsey detailed the steps their companies are taking to identify and stop foreign campaigns while also calling for more collaboration between tech companies and the government and third-party researchers.

“We weren’t expecting any of this when we created Twitter over 12 years ago,” Dorsey said. “We acknowledge the real-world negative consequences of what happened, and we take full responsibility to fix it. We can’t do this alone, and that’s why this conversation is so important, and why I’m here.”

The hearing comes with the 2018 U.S. midterm elections two months away. Major tech companies have already announced that they have found ongoing efforts to use their platforms to spread misinformation, as well as attempts to hack into political campaigns.

Since the 2016 U.S. election and the revelations that Russia had used social media to push a divisive propaganda campaign, U.S. politicians have taken a growing interest in what tech companies are doing to regulate their platforms — and whether increased government oversight is necessary.

While more than a dozen congressional committees have hosted a variety of hearings on the topic, the appearances of Sandberg and Dorsey were potentially the most significant by members of the tech industry since April, when Facebook CEO Mark Zuckerberg faced two days of questions from two congressional committees.

Google had also been invited to the hearing on Wednesday but declined to send a senior executive, instead offering its chief legal officer. The committee did not accept the offer, and so a chair with a “Google” placard was left empty during the hearing.

Numerous senators expressed frustration that Google had not sent either Sundar Pichai, its CEO, or Larry Page, CEO of Alphabet, Google’s parent company.

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

“And to the invisible witness, good morning to you,” said Sen. Amy Klobuchar, D-Minn., referring to Google’s empty chair.

Senators Burr and Warner blast Google for not attending hearing. Both show some appreciation from Facebook and Twitter for their efforts. But say more needs to be done - with help of Congress — CeciliaKang (@ceciliakang) September 5, 2018

The lines of questioning from senators covered a variety of issues, including whether the companies should notify users which accounts are bots, what responsibility they have to police content, and how they are preparing for advanced misinformation such as “deep fakes,” computer-generated pieces of audio and video that are difficult to distinguish from the real thing.

The hearing highlighted a growing consensus among tech companies and U.S. politicians about what needs to be done to prevent election manipulation and ensure social media can’t be used to jeopardize national security. Sandberg and Dorsey both agreed that users should be notified if they’re interacting with a bot account, and both acknowledged the importance of policing fake news and making sure users are informed if something is demonstrably false.

“This is an arms race so we need to be ever more vigilant,” Sandberg said. “Nothing less than the integrity of our democratic process is at stake.”

But points of dispute remained, particularly when senators asked about certain publications. When asked why WikiLeaks, after having been identified as a hostile nonstate actor by the committee, was allowed to remain on Google and Twitter, Sandberg and Dorsey said that the accounts hadn’t violated any of their policies.

While both Facebook and Twitter have grown more comfortable making some editorial decisions about where to draw the line on hate speech and inciting violence, Sandberg and Dorsey showed that their companies still wish to be thought of as neutral purveyors of content, even if that meant allowing the spread of false information.

Uh-oh. Sheryl Sandberg just said on Capitol Hill - that Facebook offers "alternative facts" alongside other postings that could be fake news. — Contessa Brewer (@contessabrewer) September 5, 2018

"We show relevant articles so people can see alternative facts,” Sandberg said when asked what Facebook was doing to fight misinformation, invoking the phrase made infamous by Kellyanne Conway, adviser to President Donald Trump, in explaining his false claims about the size of his inauguration crowd.

When asked what they were doing to stop “hoaxes,” both executives said it depended on what the definition of a hoax was. Instead of hoaxes, Dorsey said there was evidence that bad actors had “used our systems to amplify information.”

Dorsey also teased that the company could eventually introduce technology to automatically identify bot accounts and identify them to users.

"We can label them," Dorsey said. "It's really a question of implementation. We are interested in it, and we are going to do something along those lines."

Despite the social media platforms’ promises to do better, lawmakers telegraphed that the companies should expected to be regulated soon.

“Congress is going to have to take action here,” said Sen. Mark Warner, D-Va. “The era of the Wild West in social media is coming to an end.”

The most contentious exchange came outside the hearing. Infowars founder and conspiracy theorist Alex Jones, sitting in the front row for much of the hearing, exchanged heated words with Sen. Marco Rubio, R-Fla., in the hall just outside the hearing room.

Jones at one point called Rubio a “little frat boy,” with Rubio telling Jones “Don’t touch me again, man.”

Jones was recently kicked off Facebook and YouTube and put in a “time out” on Twitter for violating the companies’ terms of service. The companies had faced mounting criticism for allowing Jones to spread misinformation, such as erroneous claims that the 2012 massacre at Sandy Hook Elementary School had been staged. But his banning dovetailed with a growing crowd of right-wing voices who have complained that platforms, in downranking negative behavior, are suppressing conservative viewpoints.

Those concerns were brought up early and often during Wednesday's House Committee on Energy and Commerce hearing, at which only Dorsey testified.

Dorsey faced questions from numerous Republican committee members, which was met by criticism from Democratic members. But Dorsey remained on message, saying that the company did not discriminate against users or content based on politics.

"Impartiality is our guiding principle," Dorsey said.

In a moment of levity, a woman stood up in the back to protest Dorsey and Twitter's perceived conservative bias. She was eventually removed but not before getting drowned out by Rep. Billy Long, R-Mo., a former auctioneer who used his skills to speak over the woman.