Iran's controversial former president, Mahmoud Ahmadinejad, is having a bit of a moment on Twitter.
During his stormy eight-year term in office he hit the headlines for calling the Holocaust a "myth", denying the existence of gay people in Iran - and overseeing a ban on Twitter.
But now he's back and engaging with users worldwide via an English-language account which he uses to comment on a dizzying range of topics - from American football and Latin American politics, to Serena Williams' outfits and his own birthday celebrations.
— Mahmoud Ahmadinejad (@Ahmadinejad1956) October 26, 2018
Since he joined Twitter in January 2017, @Ahmadinejad1956 has gathered more than 76,000 followers.
He follows a small but eclectic mix of people, from the Argentine footballer Diego Maradona and US basketball star LeBron James, to Venezuela's President Nicolas Maduro and David Duke, the former Grand Wizard of the Ku Klux Klan.
So, what's going on? And how did a man once seen as a stereotypical Iranian hardliner, who left office in 2013, end up speaking to a new generation of politically-active, global social media users?
Key to understanding Ahmadinejad's tweets are his renewed political ambitions.
The former president has been a highly divisive figure in Iran since 2009, when his disputed re-election triggered the biggest protests in the country since the Revolution in 1979.
Millions of people demanded a re-run, but the Supreme Leader Ayatollah Ali Khamenei insisted the result was valid and ordered a major crackdown on dissent that saw dozens of opposition supporters killed and thousands detained.
Last year, Ahmadinejad attempted to run for president against the moderate incumbent, Hassan Rouhani, despite being warned by Ayatollah Khamenei that such a move was "not in his interest and that of the country". In the end, he was barred by the Guardian Council.
However, US President Donald Trump's decision to abandon the landmark nuclear deal negotiated by Rouhani and reimpose crippling economic sanctions on Iran appears to have presented Ahmadinejad with an opportunity.
Branding himself as a "husband, dad, grandfather, university professor, president, mayor, and proud Iranian", he has sought to return to the global political stage.
From the bottom of my heart I thank everyone for the birthday wishes.
Every birth is a beginning of a new world and universe.
we should congratulate every single person on their birthday; since God congratulated himself on the creation of man.
I wish everyone luck and prosperity pic.twitter.com/41HAsJt8QO
— Mahmoud Ahmadinejad (@Ahmadinejad1956) October 28, 2018
As a non-English speaker, Ahmadinejad is obviously not writing the English-language Tweets himself.
But the sentiments are very much his own.
Throughout his presidency he embraced a very particular personal philosophy - eschewing religious ideology in favour of his own unique blend of Iranian nationalism, anti-imperialism and mysticism.
It was a worldview that drew him to left-wing politics and liberation movements in other countries, and to leaders like Venezuela's Hugo Chavez and Bolivia's Evo Morales - often against the wishes of more traditional hardliners in the Iranian establishment.
Happy Birthday! We Miss you everyday. pic.twitter.com/y9vwowEssP
— Mahmoud Ahmadinejad (@Ahmadinejad1956) July 28, 2018
@Ahmadinejad1956 is clearly aimed mainly at an international audience, but Ahmadinejad also runs accounts in Persian on both Twitter and the messaging service Telegram, which is believed to be used by about 40 million Iranians - almost half the country's population.
In his native language he is more overtly political, often taking aim at rivals at home.
Last month, he posted online a letter he sent to Ayatollah Khamenei attacking two members of a powerful political family at the heart of the conservative establishment.
He accused Ayatollah Sadeq Larijani, head of the judiciary, and his brother Ali, who is speaker of parliament, of "disrespecting the law".
"Without evidence, they charge people with serious crimes," he wrote in the letter. "Judiciary officials comment as if they are a political party."
For some Iranians, such outspoken challenges to the country's ruling elite are exactly what they've been waiting to hear.
For others, they smack of rank hypocrisy from a man who presided over a crackdown on dissent after the mass protests in 2009.
With the people for the People pic.twitter.com/vPvJurkOQB
— Mahmoud Ahmadinejad (@Ahmadinejad1956) September 12, 2018