Iraninfo-icon's former president Mahmud Ahmadinejad took the surprise move on Wednesday of registering for next month's presidential election.

Ahmadinejad had previously said he would not stand after being advised not to by supreme leader Ayatollah Ali Khamenei, saying he would instead support his former deputy Hamid Baghaie who also registered on Wednesday.

He told reporters he remained committed to his "moral promise" to Khamenei of not running for the May 19 election.

Khamenei's "advice was not a ban," he said at the interior ministry where registration was taking place.

"I repeat that I am committed to my moral promise (of not running) and my presence and registration is only to support Mr Baghaie."

Ahmadinejad was accompanying Baghaei, who also went through the registration process.

Accompanying the two was Esfandiar Rahim-Mashaei, another former Ahmadinejad aide. The three were seen holding up their chained hands, shouting, "Viva spring, Viva Iran."

Under Iran's Constitution, presidents are allowed to serve two consecutive four-year terms. This is expected to make incumbent Hassan Rouhani a potential candidate.

Rouhani, however, has so far refused to announce his candidature, nor has he associated himself with either of the main electoral currents, the Principlist and Reformist camps.

Also contesting the polls is Ebrahim Raeesi, the chief custodian of Astan Quds Razavi, the organization managing the affairs of the holy shrine of Imam Reza, the eighth Shiainfo-icon Imam, in the city of Mashhad.

The registration process is to last for three more days and Iranians will go to the polls on May 19.