It also makes Ahmadinejad the most high-profile Iranian politician to defy the wishes of Supreme Leader Ayatollah Ali Khamenei, who has the final say in all state matters.
But many hardliners in Iran are seeking a tough-talking candidate who can stand up to Donald Trump.
The former president's chances at recapturing the office, though, seem highly unlikely - at least from a qualifying standpoint. Associated Press journalists who witnessed Ahmadinejad's registration on Tuesday said election officials were "stunned" when he submitted the paperwork.
"The irony is that by spoiling the conservatives' game and taking away from Raisi's voter-base, Ahmadinejad is in fact aiding Rouhani's re-election", said senior Iran analyst Ali Vaez of the International Crisis Group.
But the former president - whose tenure between 2005 and 2013 saw mass protests at home, plummeting relations with the West and a shattered economy - surprised everyone when he registered along with Baghaie on Wednesday. Ahmadinejad remains a deeply polarizing figure, even among hard-liners, and his decision to register for the election could be a political stunt to try to remain relevant.
During Ahmadinejad's administration, Iran faced heavy global sanctions against for its nuclear program, which Western countries said aimed to develop weapons. While the deal eased global sanctions in return for curbs on the country's nuclear programme, the trickle-down effects are yet to be felt by many of Iran's 80 million strong population.
Peter Capaldi On What Pearl Mackie Brings to Doctor Who
Since 1966, the conceit that the Doctor can shape-shift into a new body and personality has been built into the show's DNA. Did I know what any of the various buttons I pushed and I pulled were supposed to do? "But I can not reveal it".
'Only time will tell' on improving US-China trade
Xi said the delegations covered important topics and have established a good friendship and working relationship. Tillerson said Xi agreed with Trump that North Korea's nuclear advances had reached a "very serious stage".
Yankees tab Jordan Montgomery as fifth starter
Pineda recovered by retiring by Derek Norris on a groundout and then exited to a loud standing ovation from the crowd. Pineda did not allow any hard outs until Kevin Kiermaier flied out to left field for the second out of the seventh.
Internationally, he is more known for repeatedly questioning the scale of the Holocaust, predicting Israel's demise and expanding Iran's nuclear programme.
The memory of the 2009 unrest likely sparked Khamenei's comments in September. The council has six Islamic experts, hand-picked by the supreme leader, and six legal experts elected by the parliamentary Majilis.
The candidate registration for the upcoming election will last for five days.
Former populist President Mahmoud Ahmadinejad announces his intention to run for president in the May 2017 presidential elections.
Baghaei, who was imprisoned for seven months after he left office, registered alongside Ahmadinejad on Wednesday. In March, the judiciary said the case was still open, Reuters news agency reports.