Iran's former firebrand president Mahmoud Ahmadinejad will run again for office in upcoming elections in June, raising the possibility of a bolstered hardline leadership at a time of tense negotiations with the West.

Thronged by shouting supporters, Mr Ahmadinejad marched to a registration centre at the Interior Ministry where he filled out registration forms.

He held up his hands in a "V for Victory" salute, before addressing reporters.

"My presence today for registration was based on demand by millions for my participation in the election," he said, adding that the move also came after "considering the situation of the country, and the necessity for a revolution in the management of the country".

Mr Ahmadinejad has in recent years tried to polish his hardline image into a more centrist candidacy, criticising the government for mismanagement.

The Holocaust-denier has previously been banned from running for the presidency by Supreme Leader Ayatollah Ali Khamenei in 2017, although he registered anyway.

A constitutional watchdog, the Guardian Council, ultimately disqualified him.

Ayatollah Khamenei says he will not oppose the nomination of any candidate, although the electoral council may still block Mr Ahmadinejad's candidacy.

In either case, the populist's return to the political scene may energise discontent among hardliners who seek a tougher stance against the West - particularly Israel and the US.

Iran opened registration on Tuesday, kicking off the race as uncertainty looms over Tehran's tattered nuclear deal with world powers and tensions remain high with the West.

President Hassan Rouhani cannot run again due to term limits, yet with the poll just a month away, no immediate favourite has emerged among the many rumoured candidates.

There also appears to be little interest in the vote by a public crushed by sanctions and the coronavirus pandemic.

Nevertheless, many view the country's hardliners as ascendant - even as the US under President Joe Biden tries to find a way to re-enter the atomic accord.

Whoever wins the June 18 vote will take over from Mr Rouhani, a relative moderate within the Islamic Republic whose two four-year terms began with Iran reaching the nuclear deal.

His time in office now draws to a close with the accord unravelled after the US unilaterally withdrew from it under President Donald Trump in 2018.

Mr Ahmadinejad pushed his nation into open confrontation with both the West over its nuclear programme and its own people after his disputed 2009 re-election sparked the biggest mass protests since the country's 1979 Islamic Revolution.

Abroad, he became a caricature of Western perceptions of the Islamic Republic's worst attributes, such as denying the Holocaust, insisting Iran had no gay or lesbian citizens and hinting Iran could build a nuclear weapon if it chose to do so.

At home, however, the former Tehran mayor drew support from the countryside for his populist cash handouts and home-building programmes.

As his two-term presidency drew to a close and in his life after office, he also crossed the clear red line of Iran's Shiite theocracy, directly challenging Ayatollah Khamenei, who has the final say on all matters of state.

Mr Ahmadinejad entered office in 2005 and left in 2013, after the election of President Hassan Rouhani, who would go on to make the nuclear deal with world powers.

Yet even out of office, Mr Ahmadinejad sought to reinvigorate his political fortunes in public and on social media.