Protest-torn Iraq on Monday faced more political gridlock after prime minister-designate Mohammed Allawi withdrew overnight, accusing lawmakers of obstructing his attempt to form a government.

Oil-rich but poverty-stricken Iraq has for five months been rocked by the biggest wave of anti-government demonstrations since the 2003 US-led invasion toppled former dictator Saddam Hussein.

The mostly youthful protesters demand the ouster of Iraq's entire political elite, which they accuse of being inept, corrupt and beholden to powerful neighbour Iran.

Allawi's departure plunges Iraq deeper into uncertainty and leaves President Barham Saleh 15 days to propose a new candidate -- likely intelligence chief Mustafa al-Kazimi, according to political sources.

Iraqi demonstrators carry a poster of former premier-designate Mohammad Allawi covered with a red 'x' during an anti-government protest in Nasiriyah, on February 16
Iraqi demonstrators carry a poster of former premier-designate Mohammad Allawi covered with a red 'x' during an anti-government protest in Nasiriyah, on February 16 AFP / Asaad NIAZI

But Kataeb Hezbollah, a hard-line paramilitary faction backed by Iran, warned against such a choice, with a spokesman on Monday saying al-Kazimi's appointment would amount to a "declaration of war."

"He is one of those accused of helping the American enemy assassinate" top Iranian general Qasem Soleimani and Iraqi paramilitary commander Abu Mahdi al-Muhandis, who helped found Kataeb Hezbollah, spokesman Abu Ali al-Askari said on Twitter.

The two died in a US drone strike near Baghdad two months ago.

Iraq has been in legal limbo since outgoing premier Adel Abdel Mahdi stepped down in December, as the constitution makes no provisions for such a resignation.

Student protesters march with Iraqi national flags during an anti-government demonstration in Iraq's southern city of Nasiriyah
Student protesters march with Iraqi national flags during an anti-government demonstration in Iraq's southern city of Nasiriyah AFP / Asaad NIAZI

Allawi's withdrawal a month after his appointment marks another first for Iraq, which has never seen a premier-designate fail to secure parliamentary backing for a cabinet line-up.

Iraq's bitterly divided parliament had on Sunday failed for a third time to convene a confidence vote on Allawi's proposed government.

In a letter to the president, Allawi charged that some factions were "not serious about reform or fulfilling their pledges to the people".

One Iraqi official, speaking on condition of anonymity, told AFP that "political leaders are living in a bubble" and dealing with the crisis "as though nothing has happened in the country".

Oil-rich but poverty-stricken Iraq has for months been rocked by the biggest wave of anti-government demonstrations since the 2003 US-led invasion toppled former dictator Saddam Hussein
Oil-rich but poverty-stricken Iraq has for months been rocked by the biggest wave of anti-government demonstrations since the 2003 US-led invasion toppled former dictator Saddam Hussein AFP / SABAH ARAR

Allawi's withdrawal raised fears of a protracted political void, as Abdel Mahdi had pledged to formally step down by March 2, the constitutional deadline for parliament to approve a new government.

But with Allawi out of the picture, Abdel Mahdi backtracked on Monday, saying he would stay on as premier until a new government is formed.

"The most dangerous thing that we currently face is the prospect of a constitutional and administrative vacuum," he said in a statement.

Iraqi policemen stand behind barbered wire during ongoing anti-government demonstrations in Baghdad's Tahrir Square
Iraqi policemen stand behind barbered wire during ongoing anti-government demonstrations in Baghdad's Tahrir Square AFP / SABAH ARAR

Allawi had been nominated as a consensus candidate among Iraq's divided political parties and had emphasised that his cabinet would be made up of technocrats and independents.

Anti-government demonstrators had nonetheless rejected him as too close to the political elite.

The protesters have backed Alaa al-Rikaby, a pharmacist who has emerged as a prominent activist in the southern protest hotspot of Nasiriyah.

Many celebrated Allawi's departure as a victory.

"We have already removed Abdel Mahdi and now Allawi," said Roqiya, a 20-year-old student demonstrating in Baghdad.

Political commentator Hamid Abou Nour said Allawi's demise came precisely because he tried to reconcile the interests of political parties with those of the street, telling AFP that "he failed on both counts".

Allawi's successor will inherit the daunting task of reconciling the government with an angry street movement after months of demonstrations that have left nearly 550 dead and 30,000 wounded, most of them protesters.

The new candidate must first secure the backing of the most divided legislature in Iraq's history and then lead a government until early parliamentary elections, which Abdel Mahdi said could take place in 10 months.

Forming an Iraqi cabinet is a difficult task at the best of times, as quotas apportion posts to key Kurdish and Sunni and Shiite Muslim communities.

This time around, political factions have again squabbled over how to share power, with ministries "up for sale", according to political sources.

Compounding the situation, Kurdish lawmakers are expected to hold back support until they receive assurances on their share of the federal budget and of Iraq's oil revenues.

Kurdish and Sunni MPs are meanwhile at odds with Shiite lawmakers, who since Soleimani's killing have angrily called for the expulsion of 5,200 US troops stationed in Iraq.

Tensions soared further after rockets were fired at bases hosting US forces in attacks Washington blamed on Iranian-linked Iraqi Shiite paramilitaries, with further attacks reported in recent weeks.

Most recently, two rockets were fired overnight into Baghdad's Green Zone, where the US embassy and American troops are based, in the 20th attack against US assets in Iraq in four months.