Iraqi lawmakers convened Monday with Prime Minister Haider al-Abadi and a populist cleric together seeking to form a government and sideline pro-Iran rivals with a deal to create the biggest bloc in parliament.
The country's next leaders will face the mammoth task of rebuilding a country ravaged by the war against jihadists as well as tackling public anger over corruption, unemployment and decrepit public services.
Late on Sunday 16 political groups including those of Abadi and firebrand preacher Moqtada Sadr -- whose alliance with communists won the most seats in the May 12 polls -- announced an accord to create the largest force in parliament.
But they face a challenge from rivals who also claim to have the upper hand.
Abadi defended his record before lawmakers, saying he had come to power in 2014 at a time when "IS occupied large areas while the security forces were in a state of near-total collapse".
One of Abadi's aides told AFP before parliament met in Baghdad's fortified Green Zone that his coalition with Sadr and other groups included 177 lawmakers representing more than half of the 329 seats in the legislature.
That could potentially allow Abadi to remain in his post despite coming third in the election with 42 seats. Sadr's joint list won 54 seats.
A former militia leader who led two uprisings against the US-led invasion of Iraq, the cleric has called for his country to be more independent of both Iran and the United States.
But his alliance with Abadi is being challenged by former prime minister Nuri al-Maliki, who has teamed up with a group of former anti-IS paramilitary fighters close to Iran.
Maliki claimed his bloc had signatures of support from 153 lawmakers which he argued put it in a stronger position than his rivals because they only had signatures from the group leaders.
Maliki's bloc said it had poached 21 lawmakers from Abadi's Victory Alliance which, if confirmed, could tip the scales, especially since Kurdish parties are still negotiating with both sides.
Those who have switched sides include Falih Alfayyadh, who last week was sacked by the prime minister as head of the powerful Hashed al-Shaabi paramilitary force.
Abadi on Monday named himself chief of the Hashed al-Shaabi (Popular Mobilisation), which played a major role in fighting the Islamic State jihadist group (IS).
- Array of challenges -
On Monday lawmakers were sworn in before the session was adjourned. They will reconvene on Tuesday when parliament is expected to elect a speaker -- traditionally a member of Iraq's Sunni Muslim community -- as well two deputy speakers.
After that, lawmakers will have 30 days to elect a new president, a largely symbolic position that traditionally goes to a member of the Kurdish minority.
The new president will then have 15 days to task the biggest parliamentary bloc to form a new government, which will face an array of challenges including the lingering threat posed by jihadists.
Abadi declared "victory" in December over the Islamic State group after a devastating three-year war against the Sunni extremists, who at their height controlled nearly a third of the country.
Despite being driven from Iraq's towns and cities, the jihadists continue to stage attacks from their hideouts in remote desert areas.
Suspected IS members killed seven people on Monday in an attack in a village west of Kirkuk, a multi-ethnic city north of Baghdad, a security official said.
The raid came less than a day after a man was shot dead outside a mosque north of the capital, in what a police officer said was a jihadist attack.
The incoming government also faces a wave of social unrest particularly in southern Iraq, which has been shaken by weeks of protests demanding better public services in a country beset by energy and water shortages.
The meeting of parliament was delayed by allegations of electoral fraud which prompted the supreme court to order a manual recount that last month confirmed the victory of Sadr's alliance.
The polls saw a record low turnout of 44.5 percent, with long-time political figures pushed out by voters seeking change in a country mired in conflict and corruption.
Iraq's political system is designed to ensure that no one person or party can dominate, in order to avoid the return of a dictatorship following the ouster of Saddam Hussein in 2003.