At least 14 people were killed and more than 40 others wounded when gunmen in cars opened fire on a protest camp in Baghdad, sending people running for cover in nearby mosques. Three of the victims were police officers.

The attacks on Friday came a day after a string of suspicious stabbing incidents left at least 13 wounded in Baghdad’s Tahrir Square, the centre of Iraq’s leaderless protest movement.

Earlier on Friday, Iraq’s top Shia Muslim cleric said that a new prime minister must be chosen without foreign interference, as the clock ticks down on lawmakers to select a new premier following the resignation of the prime minister, Adel Abdul-Mahdi, last week.

People holding national flags and chant religious slogans march in Tahrir Square, Baghdad on Friday. Photograph: Hadi Mizban/AP

Grand Ayatollah Ali al-Sistani’s comments followed reports that a senior Iranian commander had been in Baghdad this week to rally support for a new government that would continue to serve Shia Iran’s interests.

Sistani has repeatedly condemned the killing of unarmed protesters and has also urged demonstrators to remain peaceful and stop saboteurs turning their opposition violent.

At least 400 people have died since the leaderless uprising shook Iraq on 1 October, with thousands of Iraqis taking to the streets in Baghdad and those in the predominantly Shia southern Iraq decrying corruption, poor services, lack of jobs and calling for an end to the political system that was imposed after the 2003 US invasion.

An Iraqi demonstrator in Tahrir Square on Friday. Photograph: Ahmad Al-Rubaye/AFP via Getty Images

The departure of Abdul Mahdi, who Tehran had fought to keep at the helm, is a potential blow to Iran after protests that have increasingly focused anger against what many Iraqis view as Iranian meddling in their politics and institutions.

Sistani, Iraq’s most senior Shia cleric, has long opposed any foreign interference as well as the Iranian model of senior clergy being closely involved in running state institutions.

He only weighs in on politics in times of crisis and holds enormous sway over public opinion.

“We hope a new head of government and its members will be chosen within the constitutional deadline,” a representative of Sistani said in his Friday sermon in the holy city of Kerbala. That deadline is 15 days since the resignation was formalised in parliament on Sunday.

“It must also take place without any foreign interference,” he said, adding that Sistani would not get involved in the process of choosing a new government.

The burning of Iran’s consulate in the holy city of Najaf, the seat of Iraq’s Shia clergy, and subsequent killings of protesters by security forces in southern cities paved the way for Sistani to withdraw his support for Abdul Mahdi.

Abdul Mahdi pledged to step down last week after Sistani urged lawmakers to reconsider their support for the government following two months of anti-establishment protests in which security forces have killed more than 400 demonstrators.

More than a dozen members of the security forces have been killed in the clashes.

Washington on Friday imposed sanctions on three Iranian-backed Iraqi paramilitary leaders whom it accused of directing the killing of Iraqi protesters. A senior US Treasury official suggested the sanctions were timed to distance those figures from any role in forming a new government.