Iraqi Prime Minister Adel Abdul Mahdi announced his resignation on Friday after the country's top Shiite cleric called for parliament to consider changing the government following one of the bloodiest days in two months of anti-government protests.
A statement released by the prime minister's office said he would present his resignation to parliament so that legislators could choose a new government.
Mr Abdul Mahdi's statement referred to Grand Ayatollah Ali Al Sistani's Friday sermon, saying he would submit his resignation to meet this request.
"In response to this [Sistani’s] call, and in order to facilitate it as quickly as possible, I will present to parliament a demand [to accept] my resignation from the leadership of the current government," Mr Abdul Mahdi said.
It was unclear when he would submit his letter of resignation, which should be sent to the president rather than parliament.
Article 81 of the Iraqi constitution mandates that the president fills the role of prime minister should that position become vacant. He then will have 15 days to name a new prime minister. The Iraqi prime minister is also the commander in chief, and thus the responsibilities of that position will go temporarily to the president.
Mr Al Sistani, in a sermon delivered in Najaf by his representative, said: “We call upon the House of Representatives from which this current government emerged to reconsider its options in that regard.”
The cleric also appealed for restraint from both sides after security forces killed more than 40 protesters on Thursday during a crackdown ordered by Mr Abdul Mahdi in response to the torching of Iran's consulate in Najaf.
The prime minister's statement did not mention the bloodshed, nor did he express any regret for it. He did however state that all sides “are aware that I have posed this option [of resignation] previously”.
Mr Al Sistani's sermon prompted an immediate response from two of largest Iraq's largest political blocs.
Former prime minister Haider Al Abadi of the lslamic Dawa party called for fellow members of parliament to convene on Saturday for a "special session for a vote of no-confidence and to form a new independent government".
Legislators from parliament's largest bloc, Sairoon, said they would go to their offices on Friday, which is normally a day off, to plan an "immediate" no-confidence vote.
And Qais Al Khazaali, head of the powerful Iran-backed Asaib Ahl Al Haq militia, tweeted: "Your commands will be ours, too."
Mr Al Sistani's sermon gave a major boost to ordinary Iraqis who have been taking to the streets since early October to protest against the government for failing to provide basic services and jobs despite the country's oil wealth. They are demanding political reforms to usher in a new leadership in place a ruling class they consider corrupt and inefficient, and for an end to Iranian influence over Iraqi politics.
The grassroots movement in the capital and Shiite-majority south is the largest Iraq has seen in decades but also the deadliest, with 400 people dead and more than 15,000 wounded. according tallies obtained from medical and security sources. The government has refused to issue official death tolls.
Forty-four protesters were killed and nearly 1,000 wounded on Thursday alone. The bulk of the dead, 26, fell in the southern protest hotspot of Nasiriyah, where thousands hit the streets to mourn them on Friday.
Large crowds also gathered in the city's main squares to demand the government step down, burned tyres to block highways leading north and torched another police station in the city.
Five protesters suffered bullet wounds in confrontations outside Nasiriyah's main police headquarters, according to medics.
In Baghdad, where four demonstrators died on Thursday, protesters dug in at their main camp in Tahrir Square despite skirmishes with security forces.
And in the shrine city of Najaf, a massive funeral procession wound its way through the streets carrying coffins of some of the 16 people killed there the previous day.
The unrest in Iraq's south was unleashed after protesters stormed the Iranian consulate in Najaf late on Wednesday, accusing the neighbouring country of propping up Mr Abdul Mahdi's government.
Tehran demanded Iraq take decisive action against the protesters, saying it was "disgusted" by developments.
In response, Mr Abdul Mahdi ordered military chiefs to deploy in several provinces to "impose security and restore order", but chaos reigned instead.
Men in civilian clothes opened fire at demonstrators and tribal fighters deployed in the streets in their defence.
As the death toll climbed, the premier sacked the commander he had dispatched to Nasiriyah and the provincial governor based in the city resigned.
Police officers speaking on condition of anonymity told AFP they had received orders on Thursday to "finish off" the rallies, but the heavy bloodshed put a halt to those plans.
The UN Secretary General Antonio Guterres expressed deep concern over the use of live ammunition against protesters.
“The secretary general reiterates his call on the Iraqi authorities to exercise maximum restraint, protect the lives of demonstrators, respect the rights to freedom of expression and assembly, and swiftly to investigate all acts of violence,” spokesman Stephane Dujarric said in a statement.
UK Foreign Secretary Dominic Raab condemned the "excessive use of force against protesters".
“I am also deeply concerned by attacks against Iranian consulates in Najaf and Karbala. Diplomatic premises must not be a target of violence," he added.
"The right to peaceful protest must be respected and those responsible for acts of violence held to account."
The European Union also condemned the use of live ammunition as "unacceptable", saying "those responsible must be held accountable".
The EU's diplomatic office echoed concerns expressed by the United States over attempts to restrict media coverage of the protests.
"The latest decision of the Communications and Media Commission to suspend the licence of several television channels for their coverage of the protests restricts the freedom of press and freedom of expression and is incompatible with basic democratic principles," a statement from EU External Action said.