Ahmadinejad's candidacy could have posed a strong hard-line challenge to President Hassan Rouhani, who many believe will seek a second term after his administration struck the landmark nuclear accord with world powers.
It also could have exposed the still-lingering wounds in Iran from the widespread unrest that followed his contested 2009 re-election.
"By the grace of God, I am proud to continue as a small soldier for the revolution," Ahmadinejad said in a letter to Supreme Leader Ali Khamenei.
He also wrote and publicly released a letter to President Barack Obama in August asking him to "quickly fix" a US Supreme Court ruling that allows families of people killed in attacks linked to Iran to collect damages from the country's frozen assets.
Also Read
Ahmadinejad previously served two four-year terms from 2005 to 2013. Under Iranian law, he became eligible to run again after four years.
However, Ahmadinejad as a candidate recalls some memories Iran may want to forget.
Internally, many associate Ahmadinejad with the aftermath of Iran's 2009 presidential election. He ended up winning in a contested vote count that sparked massive protests and a security force crackdown that saw thousands detained, dozens killed and others tortured.
Disclaimer: No Business Standard Journalist was involved in creation of this content