SAN FRANCISCO -- Disguised Russian agents on Twitter rushed to deflect scandalous news about Donald Trump just before last year's presidential election while straining to refocus criticism on the mainstream media and Hillary Clinton's campaign, according to an Associated Press analysis of since-deleted accounts.

Tweets by Russia-backed accounts such as "America_1st_" and "BatonRougeVoice" on Oct. 7, 2016, actively pivoted away from news of an audio recording in which Mr. Trump made crude comments about groping women, and instead touted damaging emails hacked from Clinton's campaign chairman John Podesta.

Since early this year, the extent of Russian intrusion to help Mr. Trump and hurt Clinton in the election has been the subject of both congressional scrutiny and a criminal investigation by special counsel Robert Mueller. In particular, those investigations are looking into the possibility of collusion between the Trump campaign and the Russians.

AP's analysis illuminates the obvious strategy behind the Russian cyber meddling: swiftly react, distort and distract attention from any negative Mr. Trump news.

Get Breaking News Delivered to Your Inbox

The AP examined 36,210 tweets from Aug. 31, 2015, to Nov. 10, 2016, posted by 382 of the Russian accounts that Twitter shared with congressional investigators last week. Twitter deactivated the accounts, deleting the tweets and making them inaccessible on the internet. But a limited selection of the accounts' Twitter activity was retrieved by matching account handles against an archive obtained by AP.

"MSM (the mainstream media) is at it again with Billy Bush recording ... What about telling Americans how Hillary defended a rapist and later laughed at his victim?" tweeted the America_1st- account, which had 25,045 followers at its peak, according to metadata in the archive. The tweet went out the afternoon of Oct. 7, just hours after The Washington Post broke the story about Mr. Trump's comments to Bush, then host of "Access Hollywood," about kissing, groping and trying to have sex with women, saying, "when you're a star, they let you do it."

Within an hour of the Post's story, WikiLeaks unleashed its own bombshell about hacked email from Podesta's account, a release the Russian accounts had been foreshadowing for days.

"WikiLeaks' Assange signals release of documents before U.S. election," tweeted both "SpecialAffair" and "ScreamyMonkey" within a second of each other on Oct. 4. "SpecialAffair," an account describing itself as a "Political junkie in action," had 11,255 followers at the time. "ScreamyMonkey," self-described as a "First frontier.News aggregator," had 13,224. Both accounts were created within three days of each other in late December 2014.

Twitter handed over the handles of 2,752 accounts it identified as coming from Russia's Internet Research Agency to congressional investigators ahead of the social media giant's Oct. 31 and Nov. 1 appearances on Capitol Hill. It said 9 percent of the tweets were election-related but didn't make the tweets themselves public.

That makes the archive the AP obtained the most comprehensive historical picture so far of Russian activity on Twitter in the crucial run-up to the Nov. 8, 2016, vote. Twitter policy requires developers who archive its material to delete tweets from suspended accounts as soon as reasonably possible, unless doing so would violate the law or Twitter grants an exception. It's possible the existence of the deleted tweets in the archive obtained by the AP runs afoul of those rules.

The Russian accounts didn't just spring into action at the last minute. They were similarly active at earlier points in the campaign.

When Mr. Trump reversed himself on a lie about Barack Obama's birthplace on Sept. 17, declaring abruptly that Obama "was born in the United States, period," several Russian accounts chimed in to echo Mr. Trump's subsequent false claim that it was Clinton who had started the birther controversy.

Others continued to push birther narratives. The Russian account TEN_GOP, which many mistook for the official account of the Tennessee Republican Party, linked to a video that claimed that Obama "admits he was born in Kenya." But the Russian accounts weren't in lockstep. The handle "hyddrox" retweeted a post by the anti-Mr. Trump billionaire Mark Cuban that the "MSM (mainstream media) is being suckered into chasing birther stories."

On Sept. 15, Clinton returned to the campaign trail following a bout with pneumonia that caused her to stumble at a 9/11 memorial service. The Russian account "Pamela_Moore13" noted that her intro music was "I Feel Good" by James Brown -- then observed that "James Brown died of pneumonia," a line that was repeated at least 11 times by Russian accounts, including by "Jenn_Abrams," which had 59,868 followers at the time.

According to several obituaries, Brown died of congestive heart failure related to pneumonia.

Racial discord also figured prominently in the tweets, just as it did with many of the ads Russian trolls had purchased on Facebook in the months leading up to and following the election. One Russian account, "Blacks4DTrump," tweeted a Mr. Trump quote on Sept. 16 in which he declared "it is the Democratic party that is the party of slavery, the party of Jim Crow & the party of opposition."

TEN_GOP, meanwhile, asked followers to "SPREAD the msg of black pastor explaining why African-Americans should vote Donald Trump!"