Image copyright Getty Images Image caption Automated accounts boosted the 2012 presidential campaign of Enrique Pena Nieto

Political parties in Mexico are using bots and fake accounts in an attempt to influence voter behaviour and in some cases spread false stories ahead of the country's presidential elections on 1 July, according to researchers, journalists and activists.

It's a grainy video showing a group of people. Some are milling around and others sit at computers. In front of them a man shouts into a microphone, exhorting the group to tweet quickly, to try to turn around negative chatter on social media.

"It's the moment of Mexico!" the man shouts.

The people in the video were tweeting in support of Enrique Pena Nieto of the Institutional Revolutionary Party (PRI). And the footage, from 2012, provided an insight into the operation of a "troll farm" - and the extent of social media manipulation that all major Mexican political parties have been doing for years.

Manipulating opinion

Samantha Bradshaw, a researcher with Oxford University's Computational Propaganda Project, has been tracking automated accounts, or bots, which attempt to manipulate public opinion by boosting the popularity of social media posts.

But there are other tricks deployed in aid of politicians. "Troll farms", like the one shown in the video, are run by actual humans, each of which might control dozens or hundreds of accounts. And often accounts are semi-automated, pumping out messages with a mix of computer power and human know-how.

You may also be interested in:

Bradshaw says that activity in this year's presidential election resembles what her team saw during the 2012 campaign. That election was won by Pena Nieto. It wasn't just the PRI using online tricks, however.

"The Mexican government during the 2012 elections used a lot of their Twitter bots to amplify stories and to get things, hashtags, trending," Bradshaw says.

In a paper published in 2017, Bradshaw along with researcher Philip Howard, concluded that government-sponsored "spam-bots" were used in Mexico to "target journalists" and "spread misinformation".

"These bots are often used to flood social media networks with spam and fake news. They can also amplify marginal voices and ideas by inflating the number of likes, shares and retweets they receive, creating an artificial sense of popularity, momentum or relevance," the researchers wrote.

More on this story

Online trickery

The previous use of bots and the upcoming election has concentrated the attention of the public and activists on online trickery.

Alberto Escorcia, founder of the blog Lo Que Sigue ("What's Next"), says that although the use of bots for political purposes has been detected in Mexico since at least 2010, this type of activity has intensified in recent years. He points to a 2017 governorship race in the central state of Mexico - the country's most populous state - as a prime example.

Escorcia describes the use of bots in that election as "brutal" but points out that it also raised public awareness about the issue. The race was won by the PRI candidate, Alfredo del Mazo.

In particular, he says, messages were spread through automated accounts against Del Mazo's main rival, the candidate Delfina Gomez of the National Regeneration Movement party (Morena).

Image copyright Getty Images Image caption Delfina Gomez

Escorcia says the messages spread by bots against Gomez were mainly attacks based on her gender.

"There was a clear downward trend in the last days of the election for the left-wing candidate (Gomez) and it's likely that there was an impact," he says.

For Escorcia, bot tracking has come with some personal risk. He says he has faced death threats because of his work tracking bots, and he's left Mexico in advance of the vote on 1 July.

Party denials

Although the PRI has been the focus of much of the attention of the researchers, both Bradshaw and Escorcia agree that online tricks haven't been limited to one party. All the main political parties in the country are using bots in their current campaigns, they say.

However the main political parties, including the PRI, have consistently denied they are using bots.

Alejandra Lagunes, who worked as the head of digital strategy for Pena's 2012 campaign and is now working in the same area for PRI's current presidential candidate, Jose Antonio Meade, insists that "under no circumstances" would she consent to the use of "questionable or unethical" strategies.

And JJ Rendon, a senior political strategist who worked for the PRI from 2000 to 2012, says he considers paying for bots and "troll farms" a waste of money.

"It's magical thinking," he says. "Believing that trolls would change the election or that if everyone likes you online you are winning support. It's delusional."

Rendon also claims that he's been the subject of attacks by anti-PRI bots. He says that after he gave an interview earlier this year in which he pledged to do "all he can" to stop Morena presidential candidate Andres Manuel Lopez Obrador from winning, the bot attacks intensified.

Lopez Obrador is is standing as the candidate of a three-party coalition led by Morena, which he founded. Most opinion polls show him as the front-runner in the presidential race.

Image copyright Getty Images Image caption Andres Manuel Lopez Obrador

'I want you to verify this'

The bots and trolls are spreading political messages, but there's a more fundamental concern - that they are seeding the web with false news stories.

As a response, more than sixty Mexican media outlets, universities and NGOs formed an anti-fake news initiative called Verificado 2018.

Verificado is encouraging people to send them stories on social media using the hashtag #QuieroQueVerifiquen, or "I want you to verify this." The organisation's researchers will then fact-check and publish their findings.

"In this election we are finding a lot of bots that are being used in order to promote or to attack other candidates," says Yuriria Avila, a Verificado 2018 fact-checker." "We're seeing bots are being used to promote hashtags that people wouldn't naturally use, and they become trending topics."

One piece of false news she detected in March was a report that said an opinion poll commissioned by The New York Times showed Meade - the PRI candidate - leading the presidential race with 42% of voters behind him.

The poll was fictional; most polls have instead consistently shown Meade trailing third in the race.

Image copyright Verificado 2018 Image caption Verificado 2018 is asking Mexicans to participate in a project to sniff out fake news

Avila says that a number of false stories are being shared through the messaging app Whatsapp, and because of the closed nature of that system, they have been among the most challenging things to track and debunk.

Avila says that although most parties are using bots to promote their candidates, efforts in favour of the PRI are the most visible.

"I think the PRI is having a big influence by using bots," she says, "even though I have seen other parties using them."

Do you have a story for us? Email BBC Trending.

More from Trending: Inside the dark world of 'incels'

Image copyright Getty Images

The suspect accused of a deadly van attack in Toronto wrote about an "Incel Rebellion" on Facebook, prompting huge attention on a little-known internet subculture. Who are the young men who frequent incel - short for "involuntarily celibate" - message boards?READ NOW

You can follow BBC Trending on Twitter @BBCtrending, and find us on Facebook. All our stories are at bbc.com/trending.