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

Twitter and Facebook disclosed on Thursday that the companies had coordinated to remove thousands of accounts tied to foreign governments that sought to spread disinformation in the run-up to the 2018 midterm elections.

Twitter said the Russian operation mirrored the tactics of the 2016 campaign by the Internet Research Agency, the Kremlin-backed organization whose employees were indicted by special counsel Robert Mueller for attempting to interfere in the U.S. election to favor Donald Trump.

The company said it removed 418 Russian troll accounts, which the company said aimed to inflame hot-button political debates in the U.S. The efforts were less effective than in 2016, a Twitter spokesperson told NBC News.

The accounts averaged one-third of a like and one-fifth of a retweet per post, although there was high variability with the success of the accounts.

“Through ongoing analyses and investigations, we continue to build on our contextual understanding of these networks of accounts to improve our ability to find and suspend this activity as quickly as possible in the future,” Twitter’s director of public policy Carlos Monje Jr. wrote in a statement. “This is particularly vital as groups such as the IRA evolve their practices in response to industry-wide suspension efforts.”

The Russian accounts were all removed before the 2018 midterm elections, Twitter told NBC News.

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

Twitter said it also removed about 6,000 posts from U.S.-based accounts that attempted to spread misinformation in the lead-up to the 2018 midterm elections, including tweets about how and when to vote in the midterm elections. Some troll posts told users to vote one day after polls closed, and others told users they could vote by texting a specific a telephone number.

Coordinating with Twitter, Facebook removed 783 accounts who were participating in what the company calls “coordinated inauthentic behavior” from Iran.

The accounts, which appeared on both Instagram and Facebook, were attempting to “represent themselves to be news outlets, but are controlled by actors operating from Iran.” The accounts posed as local news agencies, but “were repurposing content from Iranian government media” in 26 countries, including the U.S.

The campaign accrued followers from about 2 million accounts and spent $30,000 on Facebook and Instagram ads.

Facebook said Twitter “shared that information with us,” which helped them “build up their own investigation.” Facebook did not give specific details about information shared by Twitter about the Russian, Bangladeshi and Venezuelan accounts they identified.

The social network said it shut down 1,196 accounts that it could reliably attribute to the government of Venezuela, which mostly tweeted in defense of the country’s embattled president, Nicolás Maduro.

A separate network of 764 troll accounts from Venezuela targeted Americans, first before the 2016 election, then again in 2018. A Twitter spokesperson said these accounts exhibited a higher degree of automation than other trolling campaigns, meaning the disinformation effort used bots as well as humans.

Twitter said the Venezuelan disinformation efforts in the U.S. broadly borrowed from Russia’s Internet Research Agency playbook, pushing division about political news stateside.

The company told NBC News the accounts were shut down before tensions between President Trump’s administration and the Venezuelan government escalated over recent weeks.

Over 2,600 Iranian troll accounts, which targeted the U.S., Israel, Saudi Arabia and Pakistan, were taken down in the purge. Previous Iranian troll accounts attempted to masquerade as American news agencies and worked in the interest of Iran, which sometimes meant pushing out anti-Trump narratives to American users.