Twitter revealed Thursday that it had removed thousands of malicious accounts thought to have originated in Iran, Russia and Venezuela for spreading disinformation online, including previously undisclosed efforts to target the 2018 U.S. midterm election.

In the months before American voters went to the polls, some of these campaigns with foreign ties sought to stoke social and political unrest around hot-button issues, the company said, echoing tactics that social media companies have spent two years trying to counter. The approach had been adopted by the Internet Research Agency (IRA), an organization with ties to the Russian government, two years earlier in an attempt to steer the 2016 presidential election in favor of Donald Trump.

Twitter said it removed 418 accounts thought to have originated in Russia before Election Day in November but declined to specify exactly when and said it could not link the efforts definitively to the IRA.

Similar tactics also had been used by operatives thought to be in Venezuela: Twitter said it has removed 764 accounts originating in the country that mimicked Russia’s information operations. The company said it removed a majority of these accounts by November 2017, but nearly a quarter of more recently created accounts tweeted 50,000 times about the 2018 midterm election. Twitter said a second “state-backed influence campaign” found and disabled in Venezuela focused on the country’s own citizens.

And Twitter confirmed it found additional malicious activity originating in Iran, part of a campaign first unearthed in 2018 that sought to amplify political messages that had been broadcast by the country’s state-run media. Twitter announced that it removed more than 2,600 accounts thought to be connected to this network. About a third tweeted in English, the company said, a small fraction of which touched on the U.S. midterm election.

Foreign attempts to manipulate Twitter were “far less” prevalent than in 2016, Carlos Monje Jr., the company’s director of public policy, government and philanthropy in the United States and Canada, wrote in a blog post. He said that the “majority of these accounts were proactively suspended in advance of Election Day.” Twitter also revealed that it took action against nearly 6,000 tweets that sought to discourage voters from casting ballots on Election Day, many of which originated in the United States.

On one hand, Twitter said that the takedowns announced Thursday illustrate its progress two years after Russia’s 2016 disinformation campaign reached hundreds of millions of social-media users. Like its peers in Silicon Valley, Twitter said it spotted threats far earlier, and limited their reach, as a result of investments in new staff, clearer policies around abuse and improved artificial-intelligence tools that can challenge fake accounts or suspect posts faster than human moderators.

But the breadth of its revelations — nearly three months after Election Day — also affirms that a wider array of malicious actors worldwide is borrowing from Russia’s information-warfare playbook in a bid to destabilize the United States or push political narratives favorable to their governments. The pressure on Facebook, Twitter and their tech industry peers to improve their defenses in response is likely to intensify as the 2020 presidential election draws near.

In total, Twitter estimated that the entirety of its users sent more than 99 million tweets between the first primaries in March until Election Day, the “majority” of which came from “individuals expressing their views,” Monje wrote.

Facebook on Thursday said it had removed 783 accounts, pages and groups originating in Iran that masqueraded as foreign-language news sites to push political messages, including anti-Israeli memes. The most popular pages had millions of video views, hundreds of thousands of likes and tens of thousands of followers, according to an analysis by the Atlantic Council’s Digital Forensic Research Lab. At least one page posting in English spread anti-Western themes, including a video watched about 1 million times suggesting that the attacks of Sept. 11, 2001, were an “inside job” by the U.S. government, the analysis showed.

Previously, Facebook said in January that it had removed hundreds of pages that originated in Russia that appeared to be focused on regional weather and sports but served as a way for Russian state-owned media to secretly reach social media users.