The 64-year-old cleric is a former nuclear negotiator and Khamenei's representative on the Supreme National Security Council, which also handles the country's nuclear program.
Rohani's candidacy received a potential boost on June 11 when relative moderate Mohammad Reza Aref quit the race
, saying reformist former President Mohammad Khatami had urged him to stand down to unite the opposition vote behind Rohani.
Khatami's advisory council said later the same day that it was backing Rohani as the "reformist camp candidate."
Rohani is a member of the Assembly of Experts, a body that has the authority to elect and remove the supreme leader.
Rohani, a former deputy speaker of parliament, is close to former President Ali Akbar Hashemi Rafsanjani, who was disqualified as a candidate for this election.
In 2003, Rohani became Iran's chief nuclear negotiator and held the post until Ahmadinejad was elected president in 2005. Since then, Rohani has criticized the outgoing Ahmadinejad's economic policies and confrontational behavior on the international stage.