A compromise candidate, Adel Abdul Mahdi has 30 days to form a cabinet and present it to parliament for approval.

Newly elected Iraqi President Barham Salih has named independent Shia candidate Adel Abdul Mahdi as prime minister-designate, ending months of deadlock after an inconclusive national election in May.

The presidency, traditionally occupied by a Kurd, is a largely ceremonial position, but the vote for Salih in parliament on Tuesday was a key step towards forming a new government.

Under Iraq‘s constitution, Salih – a 58-year-old, British-educated engineer who has held office in both the Iraqi federal and Kurdish regional governments – had 15 days to invite the nominee of the largest parliamentary bloc to form a government. He chose to do so less than two hours after his election.

Since Saddam Hussein was toppled in a 2003 US-led invasion, power has been shared among Iraq’s three largest ethnic-sectarian components.

The most powerful post, that of prime minister, has traditionally been held by a Shia Arab, the speaker of parliament by a Sunni Arab and the presidency by a Kurd.

A former vice president, oil minister and finance minister, Abdul Mahdi now has 30 days to form a cabinet and present it to parliament for approval.

He faces the daunting tasks of rebuilding much of the country after four years of war with the armed group Islamic State of Iraq and the Levant (ISIL, also known as ISIS), healing its ethnic and sectarian tensions, and balancing foreign relations with Iraq’s two major allies – Iran and its rival, the US.

Abdul Mahdi, 76, is a trained economist who left Iraq in 1969 for exile in France, where he worked for think-tanks and edited magazines in French and Arabic. He is the son of a respected Shia leader who was a minister in the era of Iraq’s monarchy, overthrown in 1958.

He will become the first elected prime minister not to hail from the Shia Dawa party.

Abdul Mahdi was nominated by two rival blocs, one led by Shia leader Muqtada al-Sadr and outgoing Prime Minister Haider al-Abadi, and the other by pro-Iranian political bloc leader Hadi al-Amiri and former Prime Minister Nouri al-Maliki.

Shia conflict averted

Both blocs claim to hold a parliamentary majority but the dispute has been rendered irrelevant by their choice of the same man to be prime minister.

“The nomination of Mr Adel Abdul Mahdi came after an agreement between the Binaa bloc and the Islah bloc to nominate him via consensus and not a majority bloc in order to get past the issue of which is the majority bloc,” said Ahmed al-Asadi, a spokesman for the Binaa bloc led by al-Amiri and al-Maliki.

Ameri and Maliki are Iran’s two most prominent allies in Iraq. Al-Abadi was seen as the preferred candidate of the US, while al-Sadr portrays himself as a nationalist who rejects both American and Iranian influence.

The rival claims to a parliamentary majority and uncertainty over the composition of the new government had raised tensions at a time when public impatience is growing over poor basic services, high unemployment and the slow pace of rebuilding after the war with ISIL.

Al-Sadr’s bloc welcomed Abdul Mahdi’s nomination. The scholar earlier on Tuesday tweeted that “Iraq is bigger than the biggest bloc,” a likely reference to the compromise.

Al-Abadi issued a statement congratulating Abdul Mahdi and wishing him success.

“Abdul Mahdi’s nomination represents the best choice to pleasing all the Shia players who were about to reach a point of conflict and no return,” said Baghdad-based political analyst Ahmed Younis.

“All the Shia blocs reached the conclusion that their divisions could lead to an intra-Shia conflict which would weaken their position in Iraq,” he said. “Now, with Abdul Mahdi, there are no winners and losers, everyone is happy.”