TEHERAN (AFP) - Supreme leader Ayatollah Ali Khamenei is the most powerful figure in Iran, and the powers of the country's president over policy decisions are very limited.
But Hassan Rowhani, the moderate cleric elected to the presidency on Saturday, may find that as a figure of consensus he also has more room for manoeuvre in governing Iran.
Under the constitution, the supreme leader "defines the major policies on running the Islamic republic and... supervises them".
He also has the power to organise referendums and to declare war or peace. It is also he who appoints members of the Guardians Council, the body that oversees elections; the chief of the judiciary and the head of state television and radio.
His military powers are particularly important.
As head of the army, he can announce general mobilisation and appoint top officers - particularly in the elite Revolutionary Guards and the paramilitary Basij volunteer force - as well as in the police.
He is also responsible for solving "any intractable problem of the regime," and can "remove the president, taking into account the best interests of the country after a notice from the Supreme Court or a vote of no confidence from parliament." The guide relies on the supreme national security council on strategic questions in the country.
Officially, the president is head of the body, but it is really run by his "secretary," chosen from one of the supreme leader's two representatives.
The post is currently occupied by Mr Saeed Jalili, one of the candidates who lost out to Mr Rowhani on Saturday.
The council is made up of the defence, intelligence, interior and foreign ministers as well as the heads of parliament, the judiciary and the commanders of the armed forces.
The president of the republic is responsible for the "application of the constitution and the executive, with the exception of matters that directly concern the supreme guide".
He must also take parliament into account, as the body holds a vote of confidence in his ministers and adopts the budget.
Mr Mahmoud Ahmadinejad, the outgoing president, has complained for the past two years of a "guerilla campaign" being waged by deputies against bills he tried to pass and that his powers were being eroded.
In particular, he accused parliament, dominated by conservatives, of completely changing his proposed budget, which was only finally adopted last week, three months after the beginning of the fiscal year.
The reformist former president Mohammad Khatami, in power from 1997 to 2005, said at the end of his second term that the president was only "responsible for logistics".
Mr Rowhani will also have to deal with the conservatives who control all institutions in the country.
Even the expediency council, the body headed by moderate ex-president Akbar Hashemi Rafsanjani, is dominated by conservatives.
In the end, the president's ability to get things done depend to an extent on his personality.
A reformist official told AFP on condition of anonymity that "Rowhani's consensus-seeking personality could give him some more room for manoeuvre."
"Most of all, he has popular support but also has connections in the conservative camp," he added.
Khamenei recently highlighted the key role the head of the executive plays.
"Someone is elected for four years and takes the destiny of the country in their hands, but some decisions, good or bad, can have repercussions for forty years," he said.