"I strongly announce my candidacy," he said, according to state-run Fars news agency, Bloomberg News reported. "How is it possible to be indifferent toward the elections? We are attached to this country and are seeking its greatness," he said at a meeting in Tehran.
Khatami, 65, served two terms as president from 1997 to 2005. He was barred by the Iranian constitution from running for a third consecutive term.
During his time as president, Khatami sought improved relations with the West, and Iran agreed to temporarily stop its uranium enrichment in exchange for incentives from Western countries, though it was never settled what those incentives would be.
Then, after Ahmadinejad was elected president in 2005, Iran restarted its uranium enrichment program -- a move backed by the country's top clerics but condemned by some international leaders. Iran is currently subjected to three U.N. Security Council sanctions over its nuclear activities.
Both Khatami and Ahmadinejad support Iran's Islamic system of governance by a supreme leader, Ayatollah Ali Khamenei, but differ on matters of foreign policy, managing Iran's economy and implementing Islamic rules in society, according to the Washington Post.
Khatami was elected twice with majorities mainly consisting of young Iranians and women on platforms of enforcing the rule of law, easing social restrictions and raising living standards, Reuters reported. As president, he helped ease tensions with Iran's neighbors, improved relations with Europe and projected a more democratic image of Iran.
His policies were constantly opposed by political factions in the judiciary, the Revolutionary Guard Corps and influential clerical councils, according to the Washington Post.
Besides Khatami, Ahmadinejad will be challenged by Mehdi Karrubi, a former speaker of parliament, and Mostafa Pour Mohammadi, who Ahmadinejad fired as interior minister, reported Bloomberg News.