When Iranians elected moderate cleric Hassan Rouhani their new president by a landslide on Friday, they surprised Washington and the world. The process of figuring out what his election means has only just begun. Moderate as applied to Iranian mullah politicians is a relative term – even the reformists tip the far conservative end of the political spectrum — but Rouhani’s win represents an opportunity for easing relations between Iran and the West. The country is still led by Ayatollah Ali Khamenei, but the Supreme Leader indicated that he would allow Rouhani to engage in direct talks with the U.S., should he so wish.

Hassan Rouhani, 64, was born Hassan Feridon in Sorkheh, a city in Iran’s northern Semnan province. His family, he has said on the campaign trail, was anti-Shah and he was sent to a religious seminary in Semnan at the age of 12. A year later he moved to another seminary in Qom, the seat of Iran’s Shia branch of Islam. He took the name Rouhani, which means community of clerics, during his religious studies in the place of his ancient Persian, but non-Muslim, given name Feridon, according to Trita Parsi, founder and president of the National Iranian American Council.

So, who is Hassan Rouhani? Conservative? Reformer? Honest broker? Double dealer? As Iran nears Israel’s red line – when Israel believes it will no longer be possible to prevent Iran from getting a nuclear weapon — and risks a military conflict, Rouhani could potentially be the key to war or peace in the region.

Rouhani is no American patsy. He was one of the original revolutionaries, living in exile in Paris with Iran’s first Ayatollah Ruhollah Khomeini. His loyalty to the Supreme Leader is absolute, or he wouldn’t have been allowed to run. He’s an insider who’s spent decades atop some of Iran’s most important committees. In recent weeks he’s voiced support for Syrian strongman Bashar Assad and in his first press conference as president-elect, he insisted the time has long past for Iran to negotiate on its enrichment of low-grade uranium – that is Iran’s unassailable right. In 2004, as lead negotiator on Iran’s nuclear program, he bragged that he kept the West talking while Iran was importing advanced materials to further the program. “We will go ahead with confidence-building and will endeavor to build up our [nuclear] technical capability,” Rouhani reportedly said at a news conference at the time. “This is our diplomacy: to proceed [in] both directions simultaneously.”

Rouhani won with more than 50% of the vote, garnering more votes than all five of the hardliner candidates put together. He ran on a platform of moderation and rationality. He called for opening talks with the west, and placing the economy ahead – or at least on par – with the nuclear program as a national priority. And he advocated for the release of political prisoners, including former Iranian presidential candidate Mir-Hossein Mousavi, whose loss four years ago sparked mass protests and a brutal government crack down. Mousavi, a reformist, has been detained in an undisclosed location since. “This victory is the victory of wisdom, moderation and awareness over fanaticism and bad behavior,” Rouhani said in his first speech to the public as president-elect on Sunday.

Rouhani studied law at the University of Tehran, graduating in 1972. On the campaign trail he said that the fact that he had to pay for his own schooling gave him character. After graduation, he devoted himself full time to traveling Iran and giving anti-Shah, pro-Khomeini speeches. By 1977, he was forced to leave Iran as his life was in danger. He joined Khomeini in Paris and continued his speaking to student groups in Europe. He returned with Khomeini to Iran after the 1979 revolution and joined the government. He’s risen steadily in the political ranks since.

(MORE: A Glimmer of Hope in Iran’s Nuclear Posture, Even Before Rouhani’s Stunner)

Since the late 1970’s, Rouhani has been hailed as “doctor” in public circles, an honorarium given to many Iranian students who left advanced studies abroad to return home for the revolution. In 1995, Rouhani finally earned a masters degree in philosophy from Glasgow’s Caledonian University for a thesis entitled, “The Islamic legislative power with reference to the Iranian experience” and a PhD from the same school four years later for another thesis entitled, “The Flexibility of Shariah with reference to the Iranian experience.” He’s said to speak fluent Persian, English and Arabic and some French, German and Russian.

According to his official biography, he spent much of his early governmental years in the defense sector, serving on the Supreme Defense Council before heading the High Council for Supporting War during the Iran/Iraq war. He rose to deputy commander of the war and eventually was appointed deputy commander-in-chief of the Armed Forces in 1988. He turned down the job of intelligence minister in 1989. “This guy really was a child of the revolution,” says Cliff Kupchan, an Iran analyst with the Eurasia Group who met Rouhani at a Persian Gulf security conference organized by an Iranian think tank in the early 2000’s. “There’s a lot of conflating of Hassan with [former Iranian President and reformist] Mohammed Khatami and Mousavi. He’s not. This guy is an insider.”

In 2000, he was elected to the religious body, the Assembly of Experts, which elects the Ayatollah. In 2003 he was named Iran’s top nuclear negotiator, the only cleric before or since to hold that role, earning him the nickname the “sheikh diplomat.” At the time, he had a reputation for having the ear of Khamenei, who appointed him the chief nuclear negotiator. “People don’t realize that he’s the one who convinced Khamenei to stop the clandestine military nuclear program at the end of 2003,” says Francois Nicoullaud, France’s ambassador to Iran at the time. “This makes me optimistic now because I believe that he is a man able to take such an important steps.”

Rouhani resigned as secretary from the Supreme National Security Council when Mahmoud Ahmadinejad was elected President in 2005, and has remained a vocal critic of Ahmadinejad since. In a 2006 letter to TIME, Rouhani argued that “a nuclear weaponized Iran destabilizes the region, prompts a regional arms races, and wastes the scare resources of the region.” During the campaign, Rouhani blamed the current nuclear negotiator and presidential rival Saeed Jailili for being too uncompromising to the West and bringing crippling economic sanctions on Iran. “Ahmadinejad was very aggressive and made some unprecedented statements. Rouhani is not like that,” said Seyed Hossein Mousavian, a close deputy of Rouhani’s who fled Iran in 2007 after Ahmadinejad accused him of spying for the Europeans. Mousavian teaches at Princeton, though he now plans to return to Iran to work for Rouhani in the coming months. “He’s more of a listener. Before he talks he thinks a lot.”

(MORE: Rouhani’s Opposition to the Bomb: The Iranian President-Elect’s 2006 Letter to TIME)

Rouhani married when he was about 20 and had five children. His eldest son was assassinated in his early 20’s at the family’s home on a military base in southern Tehran, according to Mousavian. The young man, who had been training to be a pilot, was shot to death in what the family believes was a politically motivated killing, though the killer has never been found, Mousavian said. For years Rouhani investigated the death, but he ultimately “decided to be silent and not pursue it,” said Mousavian. Rouhani has four other children: one son, who is an engineer and three daughters, one of whom is married, according to his biography.

Rouhani is a workaholic, getting to work at 7am and rarely leaving work before 10pm, Mousavian said, and he’s very “demanding” on his staff. Still, Rouhani manages to slip away two–to-three times a week for walks in the mountains north of Tehran in the Velenjak area, and he regularly swims, Mousavian said. He loves Iranian cinema, traditional Iranian art and his favorite singer is Shajarian, Mousavian said. “Some people say he is reformist others say he’s conservative,” Mousavian said. “But I know him. He’s never been a conservative or a reformist. He’s always been a centrist, not believing the government can be ruled by one faction, either reform or conservative, but using capable managers from both factions.”

America doesn’t expect Iran to open up overnight. “The Supreme Leader holds the nuclear portfolio,” State Department Spokesman Jen Psaki told reporters on Monday. “We have not had expectations leading up to this election that that would change.” Israeli Prime Minister Benjamin Netanyahu noted that all of the presidential candidates were hand picked by the Supreme Leader and the West shouldn’t be fooled “into wishful thinking and weaken the pressure on Iran.” That said, White House Chief of Staff Denis McDonough said on CBS’s Face the Nation on Sunday that he sees Rouhani’s election as “a potentially hopeful sign.”

For his part, Rouhani said in his first press conference that he would like to sit down with the Americans and work out a deal akin to the one he discussed with the Europeans in 2005. In that proposal, the West would recognize Iran’s right to a civilian nuclear program and allow low grade enrichment and would dismantle the economic sanctions and in return Iran would abide by International Atomic Energy Agency standards and give complete access to inspectors, pledging to never weaponize its uranium. “The Iranian people…will be happy to build trust and repair relations with the United States,” Rouhani said. “Both nations need to think more about the future and try to sit down and find solutions to past issues and rectify things.”

MORE: In Surprise Result, Iran Elects Moderate Presidential Candidate Hassan Rouhani