Story highlights Hassan Rouhani holds a doctorate from a UK university

He had a long career in Iran's defense establishment

A senior cleric, he was Iran's chief nuclear negotiator and writes on diplomacy

He has made comments in support of Iran's rebellious Green Movement

Say goodbye to Iranian President Mahmoud Ahmadinejad.

In a few weeks, he will hand over the mantle of presidency to Hassan Rouhani, who stood victorious Saturday after Iran tallied all its votes in the national election.

Rouhani, 65, a cleric and moderate politician, who enjoyed reformist backing, took more than 50% of the vote, according to the interior ministry.

His nearest rival, Mohammad Bagher Ghalibaf, the mayor of Tehran, garnered about 15% of the vote.

Three of the six candidates were much more conservative, and the Iranian public viewed Rouhani as a mild alternative going into the vote.

JUST WATCHED See what election day is like in Tehran Replay More Videos ... MUST WATCH See what election day is like in Tehran 02:33

JUST WATCHED Iranian cartoon popular candidate on Web Replay More Videos ... MUST WATCH Iranian cartoon popular candidate on Web 05:51

JUST WATCHED Impact of sanctions on Iranians Replay More Videos ... MUST WATCH Impact of sanctions on Iranians 02:43

JUST WATCHED Erin Burnett's experiences in Iran Replay More Videos ... MUST WATCH Erin Burnett's experiences in Iran 02:19

Hawk or dove?

Rouhani has a reputation for avoiding extreme positions and bridging differences, but he is no pushover. He has a long history of service in the country's defense establishment.

He is a former commander of the Iranian air defenses, a leader on three war and defense councils, and was national security adviser to the president for 13 years before Ahmadinejad took office.

Rouhani is also a diplomatic and legal intellectual.

He has three law degrees, including a doctorate from a university in Scotland, and as president of Iran's strategic research center, he regularly publishes essays.

He serves as managing editor for three quarterlies on scientific and strategic research, and foreign policy.

He was also Iran's chief nuclear negotiator from 2003 to 2005 -- during the presidency of Mohammad Khatami , who later became one of the leading figures in Iran's rebellious "Green Movement," which erupted into street protests after the re-election of President Mahmoud Ahmadinejad in 2009.

Ahmadinejad's government violently quashed the protests with the help of elements of a unit of the Revolutionary Guard , which answers to the Ayatollah Ali Khamenei, Iran's supreme leader.

Rouhani has expressed support for the Green Movement. "These were protests that were natural and popular," he has said. "They should have been addressed."

After Green supporters chanted for him at a rally, security forces arrested members of his campaign.

Relationship with Khamenei

Rouhani's relationship with Khamenei has the potential to be complex.

He has represented the supreme leader on Iran's security council since 1989.

But he has purportedly also scrutinized him for being too rigid toward the international community, said Abbas Milani, who runs a research program on Iran at Stanford University.

In a book about his experience as Iran's nuclear negotiator during Khatami's presidency, Rouhani criticizes Ayatollah Khamenei, according to Milani.

"If you read in between the lines, he places a lot of blame on Khamenei. He says in is his book, that if it was up to him, he and his team would have come up with a solution that would not lead up to Iran's case being deferred to the U.N.-- saying 'we could have done this, and some people in Iran and some in the West torpedoed it," Milani said.

A televised presidential debate turned into an animated political clash, which touched on Iran's nuclear program. Exchanges grew so heated that the candidates were later accused of having revealed national secrets during the debate.

Rouhani was warned that he may be barred from running in the elections because of confidential material he revealed about Iran's nuclear program during the two-hour-long debate.

It wasn't his first testy moment with Iran's state-run media. He has openly accused it of censorship and publishing lies.

Many believe Rouhani was not Khamenei's favorite candidate.

Saeed Jalili, Iran's current chief nuclear negotiator, stands more in line with the supreme leader's ultraconservative Islamist views than the moderate president-elect.

But Khamenei has said he is not playing favorites and would not let on whom he voted for.

And Khamenei and his Guardian Council had to approve all candidates before the race began. Out of 680 who applied to run, only eight were allowed to do so. Two later dropped out.

Ultimately, the supreme leader approved Rouhani