Ex-Iranian President Mahmoud Ahmadinejad submitted his name on Wednesday for registration as a candidate in Iran's presidential election in May, state media reported.
Although the move by the former hardline president was seen as an attempt to bolster the candidacy of an ally, it was also a challenge to the authority of Iran's Supreme Leader Ayatollah Ali Khamenei, who had ordered him not to run.
Registration for the May 19 election started on Monday and will last five days, after which entrants will be screened for their political and Islamic qualifications by a vetting body, the Guardian Council.
President Hassan Rouhani, a moderate who engineered Iran's 2015 nuclear deal with world powers that secured a removal of international financial and trade sanctions against Tehran, is expected to seek re-election but faces a stiff challenge from conservatives who oppose the deal.
Ahmadinejad, who frequently enraged the West with his rhetoric during his eight years in office, wanted to challenge Rouhani's bid for a second term, but Khamenei ordered him last year not to nominate himself.
Khamenei, who has the final say in Iran's clerical establishment, warned in September that Ahmadinejad's candidacy could create division in the country and harm the nation.
Ahmadinejad, who had a rift with Khamenei in his final years of office, announced in a public statement in October that he would abide by the order and would not run.
However, he named one of his main allies and former deputy Hamid Baghaei as a candidate.
Ahmadinejad accompanied Baghaei to the interior ministry on Wednesday for registration.
By putting his name forward, analysts say Ahmadinejad is trying to make any disqualification of Baghaei costly for the Guardian Council. The powerful election vetting body is close to Khamenei as he appoints half of its members.
Mehr news agency quoted Ahmadinejad as saying that he registered as a candidate "only to support Baghaei."
While conservatives are worried that Ahmadinejad or Baghaei’s presence might split their votes, allies of Rouhani are also concerned about the attractiveness of populist candidates with nationalist anti-establishment slogans.
Baghaei, 48, was held under arrest in 2015 for almost seven months on charges that were not made public but many suspected were related to corruption. Iran's judiciary spokesman said in March that his case was still open.
(Reporting by Bozorgmehr Sharafedin; Editing by Toby Chopra)