When Donald Trump confronted revelations that he used money from his charitable foundation to settle private legal disputes and purchase portraits of himself, a tireless army of tweeters went to work to keep the focus on Hillary Clinton’s foundation instead.

Then Trump stumbled on a debate question about why he refuses to release his taxes, and the same army has since rushed to create the appearance of a grass-roots demand that Clinton be held accountable, instead.

@Rage_and_War tweeted “Trump's Taxes? Audit the Clinton Foundation!” with a link to a blog post suggesting the same. @Flossy_gurl tweeted, “CORRUPT #FBI #JamesComey Received Million$ From #ClintonFoundation- Brother’s Law Firm Does #Clinton’s Taxes.” And @Luminaria98 tweeted, “Hillary Clinton’s Philanthropic Controversy: The Clinton Foundation,” with a link to a critical article.

The accounts pumping out the tweets created the appearance of authentic outrage but had all the hallmarks of fakes, according to researchers who specialize in “bot” networks — short for robot — that shower social media with phony messages appearing to spring up from the grass roots.

The pro-Trump networks tweet incessantly, but only to praise Trump and bash Clinton and the media, constantly retweeting Trump staff, pro-Trump pundits and other fake accounts, thousands of which recently added “deplorable” to their usernames.

Indeed, the Clinton Foundation tweets follow a pattern of pro-Trump Twitter activity spotted by professionals throughout the campaign — accounts made to look like real people that are instead run by software and designed to amplify a certain message — that serves to neuter negative coverage of the New York businessman.

“The bot nets usually turn whatever the issue is back on Hillary,” said Phil Howard, a professor at Oxford University’s Internet Institute and the principal investigator at the Computational Propaganda Project, which has closely tracked the networks. Howard has noted the same pattern in response to stories about Trump’s refusal to release his tax returns, with bots alleging that Clinton is keeping even bigger secrets from the public. “They tend to be used to confused or muddy,” he said.

In addition to fully automated bots, Trump has benefited from the Twitter activities of “trolls,” dedicated, human provocateurs, and “cyborgs,” accounts that blend automated activity with human input.

Revelations like Trump’s allegedly illegal use of his foundation to settle lawsuits and the foundation’s allegedly illegal donation to Florida Attorney General Pam Bondi have not taken the same toll on Trump that they would on other politicians, signs of what some exasperated commentators are calling a “post-truth election.” And analysts are pointing to the growing role of these bots in polluting the online information environment.

The use of Twitter bots by pro-Trump forces is also noteworthy because the businessman has eschewed many of the traditional requisites of modern campaigning, and he has largely ceded the expensive television ad war to Clinton. Meanwhile, his message dominates the subterranean world of manufactured content on Twitter, a platform that plays an outsize role in shaping the political discourse.

As one hacker, now imprisoned in Colombia, told Bloomberg Businessweek earlier this year about his use of Twitter bots to manipulate elections across South America, “When I realized that people believe what the Internet says more than reality, I discovered that I had the power to make people believe almost anything.”

Before last year, the use of automated scripts in combination with troll labor to influence elections on social media was primarily the province of Latin America, the former Soviet Union, Syria and South Korea, where the nation’s former top intelligence official was indicted in 2013 for allegedly instructing his agency’s Psychological Operation Group to use bots in a misinformation campaign against the opposition party.

Anyone claiming that spam accounts on Twitter are distorting the national political conversation is misinformed — Twitter spokesman

It is nearly impossible to trace the financing of these efforts because multiple bot networks often engage in uncoordinated campaigns, and nearly every presidential candidate this cycle has been the beneficiary or target of apparently fraudulent Twitter activity. Further complicating matters, researchers have found that when they publicly identify automated accounts, the bots’ creators will take over and protest that the account has been run manually all along. But the lion's share of Twitter bots, cyborgs and organized trolls in this election have worked to promote a single candidate: Trump.

"The sheer scale of bot activity being perpetrated on behalf of the Trump campaign is completely unprecedented in American politics," said Samuel Woolley, director of research at the Computational Propaganda Project, who has traveled to New York City and primary states for a dissertation on the use of Twitter bots in the presidential election. “It's really evident that there's hundreds of thousands of political bots that only tweet our pro-Trump content."

Woolley estimates that 50-55 percent of Clinton's Twitter traffic — followers, like and retweets — is artificial, a typical proportion for a public figure, compared to a whopping 80 percent for Trump. Woolley said automated propaganda has become one of the biggest communication problems in politics.

A spokesman for Twitter rejected those concerns, pointing to the network’s rules against spam and saying, “Anyone claiming that spam accounts on Twitter are distorting the national political conversation is misinformed.”

And Trump spokeswoman Hope Hicks disavowed any ties to automated Twitter activity. “The Trump Campaign and the Trump Organization have not and will not be purchasing any bots for social media,” she wrote in an email.

Whoever controls the Trump bots, the uses of such networks are many. They seek to shape the information environment that voters encounter by harassing critics into silence, spreading misinformation, energizing supporters by making them feel like part of a thriving movement, making the expression of fringe views appear socially acceptable, and shutting down conversation around certain keywords by flooding that conversation with disturbing or useless information.

In the case of pro-Trump bots, a favored tactic is to muddy the waters around the candidate’s most controversial statements by broadcasting contradictory messages about them. Howard said that when online conversation heats up about Trump’s proposed border wall, bots designed to look like Latino Trump supporters will spring into action with mixed messages.

“They will say things like ‘We want a wall too’ or they’ll say, ‘He didn’t say wall, he meant a better border,’ or ‘he meant a wall but it’s actually much smarter than you think,’ ” Howard said.

Howard said the spreading of such mixed messages on Twitter was pioneered by Kremlin bots after a Russian-made missile shot down a Malaysian airliner over eastern Ukraine in July 2014. The networks promoted contradictory reports that Americans shot down the plane or that Ukranians shot it down because they believed Vladimir Putin was aboard. The misinformation campaign successfully muddled public opinion in former Warsaw Pact countries.

"A lot of these unsavory tactics that you would see in international elections are being imported to the US," said Republican strategist Patrick Ruffini. In April, Ruffini tracked the activity of 465 Twitter accounts that all urged recipients of Ted Cruz robocalls to complain to the Federal Election Commission. He found the accounts tweeted more than 400,000 times about Trump in a month and retweeted Trump’s social media director Dan Scavino 13,000 times. He also found that the accounts simultaneously tweeted identical messages promoting “social media marketing tips” and “fashion beauty news.”

Ruffini, like many prominent figures who tweet information adverse to Trump’s interests, was besieged by bots after he publicized those findings. "I had 30,000 mentions over a weekend," he said. “There is very clearly now a very conscious strategy to try to delegitimize opposition to Trump."

In the months since Ruffini’s investigation, pro-Trump Twitter bot and cybog activity has grown more sophisticated. According to Howard, the pro-Trump bots activated in recent weeks are from older “sleeper” accounts — more expensive ones that lie low for years after their creation so that they do not appear to have been created in the middle of a campaign for the sole purpose of spreading propaganda. “My concern is that most social media users can’t differentiate between a real person and a good bot,” Howard said.

Today, fewer of the bots are “eggs,” accounts that have not bothered to upload a profile picture and are therefore more easily identified as fraudulent. According to Vlad Shevtsov, a Russian computer scientists who has obsessively tracked fraudulent Twitter activity related to the election, algorithms now scrape profile pictures from the Internet, stamp them with one of a variety of pro-Trump logos and upload them to bot accounts. Shevstov has discovered a number of examples of the algorithms accidentally stamping one pro-Trump logo on top of a scraped picture that already featured another algorithm’s pro-Trump logo, like a rare, misstamped coin.

Since Clinton made her much-criticized remark that half of Trump’s supporters belong in a “basket of deplorables” and his campaign moved to own the label, thousands of Trump’s bot supporters have stayed in step with the messaging by updating the names of their accounts to “Deplorable Melissa,” “Deplorable Mr. Nobody” and “Deplorable Con Man,” who on Monday replied to a tweet by “Deplorable Tax Dude” with apicture of Trump antagonist Mark Cuban posing with a scantily clad woman.

Among other tactics, the “deplorable” accounts have been working to promote hashtags related to Clinton’s health. An account called Deplorable Susie, tweeted "Omg, Hillary's having a mental breakdown. #SickHillary." An account called “Deplorable-Eddie T” tweeted an unflattering photo-shopped image of Clinton wearing 3-D glasses with the caption, “Feeling fine & back on the campaign trail ! I just need these glasses so I don't faint #HillarysHealth.” And “Deplorable Colleen” responded to a Clinton tweet about standing up to Trump with, “Lady U Can't STAND Unassisted Never mind STAND Up 2 Anything #CrookedHillary #HillarysHealth.”

Clinton’s health became a major news story earlier this month after she fainted at a Labor Day event in New York, but there is now little Twitter activity related to the topic other than manufactured tweets like those, according to Shevtsov.

While pro-Trump bots and cyborgs are far and away the most active, automated Twitter activity it is not regulated by the FEC, and its use extends well beyond promoting the New York businessman.

In June, when Clinton responded to a Trump attack by tweeting at him, “Delete your account,” she earned glowing media attention for breaking this election cycle’s retweet record.

But Shevtsov found thousands of bot accounts with variations of the name “Order followers” — barely disguised bots — among those retweeting the former secretary of state. During the Democratic primary, Shevtsov also tracked a large network promoting Bernie Sanders. When Sanders received bad press because a group of supporters known as “Bernie Bros” was apparently harassing journalists online, his digital director, Kenneth Pennington, suspected the Vermont senator was being set up by opponents looking to manufacture negative headlines.

“We'd look at the account and it would be a brand new account created this month and it had four tweets and it was all trying to bait journalists into quoting it," he said.

Trump has also been the target of Twitter shenanigans. On Tuesday, a photo purporting to show that the post-debate hashtag #TrumpWon originated from accounts in Russia went viral before it was revealed as a fake.

Often, the beneficiaries of bots do not even know about them, because they are controlled by PACs, outside supporters, subcontractors or overzealous staffers. "It’s someone on the team who goes rogue," said Seth Weathers, a Republican operative who briefly served as Trump’s Georgia state director.

Trump has placed himself much closer to the bot activity taking place on his behalf, pioneering the unprecedented practice — for an American political figure — of regularly retweeting pro-Trump bots and cyborgs.

The Computational Propaganda Project has found bot creators in Seattle, Silicon Valley and throughout the country. “Where do these fake messages come from? Content management firms and advertising firms that have been using bots for ages and ages to sell crappy products,” explained Woolley.

While political operatives know which content management firms to go to for Twitter astro-turfing, campaigns take care to keep their distance from such activity with subcontracting arrangements that will not show up on FEC reports. And the firms that create or purchase bots on behalf of politicians take care to cover their tracks.

"They’re smart about it," said Jim Vidmar, a computer programmer who operates bot networks commercially and has sold to clients working on behalf of House and Senate candidates. "It’s done under total secrecy: profile just created, burner phone, not traceable."

The pro-Trump activity is especially mystifying because it is so varied. For one, the candidate has inspired significant organic activity from real-life super fans on social media. Many of them spend hours a day on social media, sharing and creating content about the election. Ken Crow, an Iowa Tea Party activist who helped create the grass roots group Citizens for Trump, said the organization has a squad of several supporters dedicated to pushing pro-Trump messages on social media and pushing back on negative stories.

Much bot activity is designed to interact with and energize real supporters like these, blurring the lines between organic and artificial support. "It looks like they’re getting action, so they’re getting reinforced," said Weathers of the psychology behind using bots to retweet and follow real supporters.

Crow said his Twitter following has nearly tripled to 18,000 since Trump entered the race, and he credited that growth to his use of the #MAGA hashtag, an abbreviation of Make America Great Again. "If you put that in every one of your messages, you get followers," he said. (According to Shevtsov, the bot networks also engage with tweets by journalists, to subtly reinforce the behavior of tweeting about Trump.)

Other bots are controlled by Trump’s alt-right and white nationalist fans. After experimenting with a script — a short program for automating activity — that automatically replies to Trump’s tweets, Nathan Bernard, a young coder who is neither a Trump supporter nor a white nationalist, started a podcast about Twitter bots. Through those forays into that underworld, Bernard has struck up online conversations with owners of pro-Trump white nationalist Twitter accounts like keksec_org and the now-banished WhiteGenocideTM (which Trump has retweeted more than once), who have told Bernard about their use of bot networks to promote the New York businessman.

Still other pro-Trump bot activity has foreign origins. Last year, journalist Adrian Chen investigated a Russian organization that runs Kremlin-aligned trolls and bots. In December, Chen said he checked in on list of the Kremlin bots and found they had changed their identities to look like American conservatives and were tweeting about Trump — a sign either that Russia is working to boost the Republican nominee or that the bots have been repurposed for a new client.

Consultant JJ Rendon does not advise his clients to use bots and he considers them next to useless: “They are as effective as mosquitos without Zika."

Trump has placed himself much closer to the bot activity taking place on his behalf, pioneering the unprecedented practice — for an American political figure — of regularly retweeting pro-Trump bots and cyborgs. By Shevtsov’s count, Trump quoted 150 fake accounts in the first three months of 2016 alone. At least some of that appears to be inadvertent, like when Trump infamously retweeted a Benito Mussolini quote from a bot set up by Gawker for the sole purpose of tricking Trump into quoting the Italian fascist dictator.

But Shevtsov believes Trump, or his team, quotes bots intentionally, citing Trumps’s retweet of a bot to promote Miss Universe in January 2015, before his presidential run and his notorious retweet of an unflattering picture of Heidi Cruz.

In March, Trump drove days of coverage when he retweeted a picture of Cruz that had been posted by @Don_Vito_08, an account that recently changed its named to “DEPLORABLE Don Vito” and that Shevtsov has identified as a partly automated pro-Trump cyborg. The Russian computer scientist believes Trump allies planted the photo so that he could retweet it — allowing him to use his oft-deployed defense of inflammatory tweets that he was merely retweeting something.

“If Trump declared himself the author of the picture, it would be too straightforward. It would have looked like a violation of the rules,” wrote Shevtsov on SadBotTrue, his wryly written blog, composed in stilted English, about fraudulent Twitter activity in the presidential election and beyond.

“This is totally and completely false,” Hicks responded, pointing out that bots violate Twitter’s rules.

Because advanced uses of Twitter bots are so new and employed secretly, researchers have had trouble quantifying their impact. Whether pro-Trump bots are making a sizeable impact remains an open question.

Andres Sepulveda, who hacked elections across Latin America and is now serving a 10-year prison sentence in Colombia, is convinced these tactics works.

And Sepulveda told Bloomberg Businessweek he is “100 percent sure” the U.S. presidential election is being manipulated in a disturbing April article about his election-rigging work across the hemisphere.

Supulveda also told the magazine he did most of his work while on the payroll of JJ Rendon, a consultant sometimes called “the Karl Rove of Latin America” who denied Sepulveda’s account of their relationship and said he never employed the jailed hacker to do anything illegal.

Rendon told POLITICO that he does not advise his clients to use bots and that he considers them next to useless. “They are as effective as mosquitos without Zika," said the Miami-based consultant.

And despite his knowledge of bots, Weathers, the Georgia operative, said he does not advise his clients to use them and does not consider them effective. "They’ve left no mark on history, let’s put it this way," he said.

At least not yet. But Howard, the Oxford professor, believes they have already affected the information ecosystem around the campaign, beyond the social network itself. And he’s alarmed by the possibility that they have a dramatic last act in store: millions of dormant Twitter bots awakening to unleash a nasty November surprise, spreading misinformation that tips the election at the last minute.

“What keeps me up at night is that a massive bot network might pick up a piece of misinformation the night before the election and really mess with public opinion,” he said. “If [Trump allies] were to activate them the night before the election or the day of and say, ‘Hillary Clinton’s dead’ or something, that would cause huge problems.”