TEHRAN (Press Shia) – Iraq’s parliament on Tuesday elected as president Kurdish politician Barham Salih, who immediately named Adel Abdul Mahdi prime minister-designate, ending months of deadlock after a national election in May.

The presidency, traditionally occupied by a Kurd, is a largely ceremonial position, but the vote for Salih was a key step toward forming a new government, which politicians have failed to do since the election.

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, Reuters reported.

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 Daesh terrorists and healing its ethnic and sectarian tensions

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 Shiite cleric who was a minister in the era of Iraq’s monarchy, overthrown in 1958.

Abdul Mahdi was nominated by two rival blocs, one led by cleric Moqtada al-Sadr and outgoing Prime Minister Haider al-Abadi, and the other by leader of Badr Organization Hadi al-Amiri and former premier Nuri al-Maliki.

“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 Amiri and Maliki.

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

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