Iraqi soldiers are battling to drive the Islamic State out of Fallujah. But just beyond the edges of the flashpoint city are Shiite militias that many Iraqis fear could undermine the campaign against the radical group.

These government-aligned militiamen have helped push the Islamic State out of key areas of the country but also have become a complication for the U.S.-backed military coalition assembled to destroy the hard-line Sunni group. They filled an important void left by Iraq’s weakened armed forces, but their religiously motivated agenda has aggravated Iraq’s combustible sectarian divisions.

That is particularly problematic in a place like Fallujah, in Iraq’s Sunni heartland, where residents have a history of revolt. A decade ago, al-Qaeda militants staged a punishing insurgency against then-occupying U.S. troops. Anger at the government in Baghdad helped the Islamic State win control of the area in January 2014.

Iraq’s government has ordered the militias to stay away from the fighting inside the city. And the U.S. military says it refuses to give them air support, fearing that their involvement could help the Islamic State rally besieged residents to its cause.

The militias “are sectarian just like Daesh is sectarian,” said Majid al-Juraisi, a tribal leader from the city who fled to Baghdad when the Islamic State took control. Daesh is the Arabic name for the Islamic State, also known as ISIS and ISIL.

“We reject their involvement in this campaign — completely,” he said.

Progress by Iraqi forces toward entering the city appeared to have been substantially slowed by a fierce counterattack by the Islamic State on Thursday. The militant group has booby-trapped the city with improvised explosive devices, sniper nests and hidden tunnels that help its fighters stage surprise attacks.

Maj. Gen. Saad Harbiya, commander of military operations west of Baghdad, also said the Islamic State is using some of the estimated 50,000 civilians in the city as human shields.

“Daesh defenses were fierce at the beginning of the operation, but we see signs that they are being weakened, and we are confident that we will push them out,” he said.

The militias — mostly Shiite Muslim groups known collectively as popular mobilization units, or PMUs — have a reputation for brutal reprisals against Sunnis suspected of being loyal to the Islamic State. Iraqis and human rights groups have accused them of torture, forced disappearances and executions.

Iraqi officials fear that in Fallujah, about an hour’s drive west of Baghdad, the militias’ reputation has played into the hands of the Islamic State. The group appears to be telling residents that the government’s assault will result in sectarian slaughter.

Starting in 2013, Fallujah residents rebelled against Iraq’s Shiite-dominated government, citing years of official neglect and other grievances, and the unrest eventually helped the Islamic State take control of the area.

Those grievances may still be raw for many in Fallujah, even though their patience for the Islamic State’s brutal rule appears to have long ago evaporated.

Prime Minister Haidar al-Abadi has gone out of his way to deemphasize the role being played in the campaign by the militias, which are still shelling the city and making sectarian-tinged pronouncements from the outskirts of town. The militias — many of which are heavily influenced by neighboring Iran, a Shiite powerhouse — hold considerable sway over the Western-friendly premier.

He has been weakened recently by anti-government protests and rising public anger over his handling of Iraq’s crises. A recent spate of Islamic State-perpetrated bombings of Shiite areas in Baghdad has increased the pressure on Abadi to launch an assault on Fallujah, even as his U.S. allies prefer that he focus on retaking the northern city of Mosul from the group.

Abadi appears even more vulnerable to the whims of the militias, which appear to be itching to exact revenge on Fallujah for the Islamic State bombings in the capital, said Michael Pregent, an Iraq expert at the Hudson Institute.

“Shiite militias want to punish Fallujah for continued [Islamic State] attacks on Shiite areas in and around Baghdad. Abadi is powerless to stop the IRGC-backed Shiite militias,” he said, using initials to refer to Iran’s Revolutionary Guard Corps, which is believed to fund and train the militias.

Ahmed al-Assadi, a spokesman for the PMUs, denied accusations of abuse. He noted that the PMU groups fall firmly under the authority of the prime minister’s office and said their fighters would obey orders not to enter Fallujah.

Fighting in the city “is the job of the counterterrorism forces, the military and the police. Our mission is to surround areas on the outskirts, help with the siege. But we stand ready to give further assistance if required,” Assadi said.

U.S. coalition air raids in support of Iraqi troops would stop if the militias started to fight inside the city, said Army Col. Chris Garver, a spokesman for the coalition. Only government forces and approved Sunni militiamen are receiving supportive airstrikes, which have totaled 48 around Fallujah in the past two weeks, he said.

“We won’t shoot in support of units that are not properly aligned with the government of Iraq,” Garver said.

But to some Iraqis, especially Sunnis, that separation appears to be little more than show. They see the United States as willfully allied with the militias and Iran, which also has played a major role in the operation to win back Fallujah. Iran has dispatched advisers to the battlefield, such as Qasem Soleimani, the country’s most powerful spy commander.

“The militias didn’t participate in the liberation of Ramadi because the Americans said no,” said Juraisi, the tribal leader, referring to the Islamic State’s expulsion from the capital of Anbar province in December.

“So what is being done in Fallujah has been given approval by the Americans, and in Iraq that matters more than what the Iraqi government decides,” he said.