TEHRAN, Iran — Just weeks after Mahmoud Ahmadinejad’s election victory in 2005, Iran’s top nuclear negotiator Hasan Rowhani stepped down from the post after quarrelsome meetings with the new president.

The decision cemented Rowhani’s reputation as a moderate who rejected Ahmadinejad’s combative approach in world affairs in favor of the more nuanced philosophy of Ahmadinejad’s leading political foe, former President Akbar Hashemi Rafsanjani.

Rafsanjani was rejected by Iran’s election guardians from Friday’s presidential ballot. But for many reformists and liberals in Iran, the 64-year-old Rowhani is somewhat of a mirror image of the elder Rafsanjani by reflecting his outlook that Iran can maintain its nuclear program and ease tensions with the West at the same time.

Rowhani held a wide lead in early vote counting Saturday.

“Rafsanjani was really the only choice to re-energize reformists,” said Rasool Nafisi, an Iranian affairs analyst at Strayer University in Virginia. “Rowhani only got their support because he is seen as Rafsanjani’s man and a vote for Rowhani was a vote for Rafsanjani.”

This deep connection between the two men could give a potential Rowhani presidency a dual nature: Rowhani as the public face and Rafsanjani behind the scenes as its powerful godfather and protector.

Although all key policies such the nuclear program are directed by the ruling clerics, the alliance with Rafsanjani may give Rowhani more latitude to put his stamp on Iran’s negotiation tactics with world powers after four rounds of talks since last year have failed to make any significant headway.

At campaign rallies, Rowhani has pledged to seek “constructive interaction with the world” that includes efforts to ease Western concerns about Iran’s program and lift punishing international sanctions that have pummeled the economy. The West and its allies fear Iran could be moving toward development of a nuclear weapon. Iranian officials, including Rowhani, insist that the country only seeks nuclear reactors for energy and medical applications.

“We won’t let the past eight years be continued,” Rowhani told a cheering crowd last week in a clear reference to Ahmadinejad’s back-to-back terms. “They brought sanctions for the country. Yet, they are proud of it. I’ll pursue a policy of reconciliation and peace. We will also reconcile with the world.”

Rowhani – the only cleric in the six-candidate presidential field – started religious studies at a teenager. He soon established himself as an outspoken opponent of the Western-backed shah, traveling frequently for anti-monarchy speeches and sermons that caught the attention of Ayatollah Ruhollah Khomeini, the eventual leader of the 1979 Islamic Revolution.

Rowhani later graduated from Tehran University with a law degree in 1972. He then went abroad to Glasgow Caledonian University for a master’s degree in legal affairs, according to his campaign biography.

While outside Iran, the stirrings of the Islamic Revolution were growing stronger. Rowhani returned to Iran and stepped up his denunciations of the shah, but fled the country to avoid arrest. He then joined up with Khomeini, who was in self-exile in France, and the rest of his inner circle, including Rafsanjani.

After the revolution, Rowhani rose quickly with various roles, including reorganizing the military, serving in the new parliament and overseeing the state broadcaster, which became a valued mouthpiece for Khomeini.

He strengthened his ties to Rafsanjani during the 1980-88 war with Iraq and, later, as Rafsanjani’s top national security adviser during his 1989-97 terms. Rowhani continued the role with reformist President Mohammad Khatami, who also appointed Rowhani as the country’s first nuclear envoy.

Rowhani took over the nuclear portfolio in 2003, a year after Iran’s 20-year-old nuclear program was revealed. Iran later temporarily suspended all uranium enrichment-related activities to avoid possible sanctions from the U.N. Security Council.

Ahmadinejad strongly opposed any such concessions and deal-making. He also had carry-over friction with Rowhani, who backed his mentor Rafsanjani against Ahmadinejad in the 2005 race.

Rowhani resigned as nuclear negotiator and head of the Supreme National Security Council after a few testy postelection meetings with Ahmadinejad.

In his campaign stops, Rowhani had been careful not to directly confront authorities over crackdowns since Ahmadinejad’s disputed 2009 election. But Rowhani was seen as clearly siding with Ahmadinejad’s reform-minded opponent four years ago, Green Movement leader Mir Hossein Mousavi, who was placed under house arrest in early 2011 along with fellow opposition candidate Mahdi Karroubi.

Taking a page from Mousavi’s color-branded campaign, Rowhani adopted purple for his run for the presidency. It also brought some backlash, including several supporters arrested at a rally that brought cries from the crowd for the release of Mousavi and Karroubi.

At Rowhani’s final campaign event earlier this week, chants rang out: “Love live reforms.”

___

Murphy reported from Dubai, United Arab Emirates.

Also on HuffPost:

Loading Slideshow...
  • In this photo released by an official website of the Iranian supreme leader’s office, Supreme Leader Ayatollah Ali Khamenei casts his ballot in the presidential election without publicly endorsing a candidate, in Tehran, Iran, Friday, June 14, 2013. (AP Photo/Office of the Supreme Leader)

  • A little girl helps her mother with casting a ballot at a polling center during the presidential election in Basra, 340 miles (550 kilometers) southeast of Baghdad, Iraq, Friday, June 14, 2013. (AP Photo/ Nabil al-Jurani)

  • An Iranian man casts his ballot at a polling center during the presidential election in Basra, 340 miles (550 kilometers) southeast of Baghdad, Iraq, Friday, June 14, 2013. (AP Photo/ Nabil al-Jurani)

  • Head-to-toe veiled Iranian women attend a polling station to vote for the presidential and municipal councils elections in Tehran, Iran, Friday, June 14, 2013. (AP Photo/Vahid Salemi)

  • A member of the electoral committee takes information from a passport of an Iranian voter for the presidential election in the Iranian Embassy in Beirut, Lebanon, Friday, June 14, 2013. (AP Photo/Bilal Hussein)

  • Iranian women stand in line at a polling station during the presidential election in Qom, 125 kilometers (78 miles) south of the capital Tehran, Iran, Friday, June 14, 2013. (AP Photo/Ebrahim Noroozi)

  • Iranian women stand in line at a polling station during the presidential election in Qom, 125 kilometers (78 miles) south of the capital Tehran, Iran, Friday, June 14, 2013. (AP Photo/Ebrahim Noroozi)

  • Iranian women stand in line at a polling station during the presidential election in Qom, 125 kilometers (78 miles) south of the capital Tehran, Iran, Friday, June 14, 2013. (AP Photo/Ebrahim Noroozi)

  • Women wait in line at a polling station to vote during presidential elections in Qom, 125 kilometers (78 miles) south of the capital Tehran, Iran, Friday, June 14, 2013. (AP Photo/Ebrahim Noroozi)

  • Iranian women wait in line at a polling station to vote during presidential elections in Qom, 125 kilometers (78 miles) south of the capital Tehran, Iran, Friday, June 14, 2013. (AP Photo/Ebrahim Noroozi)

  • Iranian presidential candidate Hasan Rowhani, a former Iran’s top nuclear negotiator, casts his ballot during presidential elections at a polling station in downtown Tehran, Iran, Friday, June 14, 2013. (AP Photo/Vahid Salemi)

  • Iranian women walk past posters of presidential candidate Saeed Jalili, Iran’s top nuclear negotiator, a day prior to the election, in Tehran, Iran, Thursday, June 13, 2013.(AP Photo/Vahid Salemi)

  • An Iranian woman crosses a street, a day prior to the presidential election, in Tehran, Iran, Thursday, June 13, 2013. (AP Photo/Vahid Salemi)

  • Two Iranian women look at a banner of presidential candidate Ali Akbar Velayati, a conservative Foreign Minister, a day prior to the election, in Tehran, Iran, Thursday, June 13, 2013. (AP Photo/Vahid Salemi)

  • In front of a portrait of Iranian supreme leader Ayatollah Ali Khamenei, a supporter of presidential candidate, Ali Akbar Velayati, a conservative former foreign minister, chants slogans in a campaign rally, two days prior to the election, in Tehran, Iran, Wednesday, June 12, 2013. (AP Photo/Vahid Salemi)

  • Men and women attend a campaign rally in support the Iranian presidential candidate Saeed Jalili, Iran’s top nuclear negotiator, two days prior to the election, in Tehran, Iran, Wednesday, June 12, 2013. (AP Photo/Vahid Salemi)

  • Iranian women hold their documents as they queue to vote in the first round of the presidential election at a polling station in Tehran on June 14, 2013. (ATTA KENARE/AFP/Getty Images)

  • Former Iranian president Akbar Hashemi Rafsanjani casts his vote in front of a portrait of Islamic revolutions late founder, Ayatollah Ruhollah Khomeini, at a polling station in Tehran on June 14, 2013 during the first round of the presidential election. Iranians are voting to choose a new president in an election the reformists hope their sole candidate will win in the face of divided conservative ranks, four years after the disputed re-election of Mahmoud Ahmadinejad. (STR/AFP/Getty Images)

  • Tehran’s mayor and presidential candidate, Mohammad Baqer Ghalibaf (C) prays at the tomb of Shah Abdolazim before voting in the first round of the presidential election on June 14, 2013 at a polling station at Shah Abdolazim mausoleum in southern Tehran. Iranians are voting to choose a new president in an election the reformists hope their sole candidate will win in the face of divided conservative ranks, four years after the disputed re-election of Mahmoud Ahmadinejad. (BEHROUZ MEHRI/AFP/Getty Images)

  • Iranian women hold their documents as they queue to vote in the first round of the presidential election at a polling station in Tehran on June 14, 2013. (ATTA KENARE/AFP/Getty Images)

  • Iran’s top nuclear negotiator and conservative presidential candidate, Saeed Jalili waves after voting in the first round of the presidential election on June 14, 2013 at a polling station at Shah Abdolazim mausoleum in southern Tehran. (BEHROUZ MEHRI/AFP/Getty Images)

  • An Iranian woman casts her vote in the first round of the presidential election at a polling station in Tehran on June 14, 2013. (ATTA KENARE/AFP/Getty Images)

  • Iranian women wait in a queue to vote at a polling station at the Massoumeh shrine in the holy city of Qom, 130 kms south of Tehran, during presidential elections in the Islamic republic on June 14, 2013. (SEDA RAVANDI/AFP/Getty Images)