After a series of bruising electoral defeats, Iranian conservatives campaigning in this week's presidential poll have belatedly embraced social media -- a space long dominated by their reformist rivals.
Across Iran's political spectrum, posting on social media has increasingly replaced street campaigning as the crucial way to rally supporters and attack opponents -- even if some of the most popular sites such as Twitter remain officially banned.
Hardline Tehran mayor Mohammad Bagher Ghalibaf has used Twitter and messaging app Telegram, which has 25 million users in Iran, to release documents accusing his rivals of corruption.
When moderate President Hassan Rouhani, who is seeking re-election, visited the site of a mining disaster last week, conservatives posted a video of his car being attacked by protesters which quickly went viral.
Another conservative candidate, cleric Ebrahim Raisi, has live-streamed his rallies on Instagram and given unprecedented online question-and-answer sessions.
It marks a significant shift in a country where conservatives have tended to respect bans on Twitter, Facebook and YouTube -- leaving reformists a relatively free run on social media.
The bans date back to the 2009 election when Twitter and Facebook were widely used to rally support for reformists and then to organise mass protests when they claimed the result was rigged in favour of hardliner Mahmoud Ahmadinejad.
"The reformist camp always had the upper hand on social media" during 2009 and 2013 elections, journalist Sadra Mohaghegh told AFP.
Conservatives finally came round after a massive defeat in urban areas at last year's parliamentary elections, in which reformists scored a clean sweep of Tehran's 30 seats.
"Until then the conservatives had not realised the power of social media, but after that they realised they had to join the game," said Mohaghegh, who writes for reformist daily Shargh.
Reformists have continued to score hits on social media.
When hardliner Ghalibaf claimed he supported female empowerment in the workplace, critics published documents showing he had called for gender-segregated offices at Tehran municipal offices.
But Iran's hardliners have some powerful assistance.
Some 18,000 "volunteers" regularly scour the internet for anything deemed subversive, a top judiciary official said in February.
The arrests in March of 12 heads of popular reformist channels on Telegram sent a chill through the online community.
Six are still in jail, despite criticism from Rouhani and another lawmaker who blamed the elite Revolutionary Guards and told them to stay out of politics.
Rouhani has made civil liberties, including online freedom, a key theme of his campaign.
His administration has rolled out high-speed Internet across the country, making it harder for the authorities to limit access.
"The era of one state broadcaster dominating people's minds is over," he said at a campaign rally on Saturday.
"We will set up the communications infrastructure so that each one of you can become the broadcaster with your mobile phones. We will not let Iran become isolated once again."
The online mud-slinging has smeared both sides in a bitterly fought contest.
But the use of social media has at least boosted voter interest in the election, and officials are keen to see a high turnout in order to buttress the regime's legitimacy.
"I think everyone has embraced the competitive campaign atmosphere -- it helps build up the hype and enthusiasm," Mohaghegh said.