A mix of Iraqi security forces and Shiite militias aligned with the government are poised to attempt to break the Islamic State’s five-month siege on Iraq’s largest oil refinery after a series of military gains along the country’s main north-south highway, according to Iraqi security officials and local residents.

The refinery on the outskirts of the predominately Sunni Muslim town of Baiji has been surrounded by a mix of fighters that includes local Sunni tribes hostile to the Shiite-dominated central government, the Islamic State and smaller units of former Baathist military commanders, who have formed a loose alliance since taking over Iraq’s second largest city, Mosul, in June.

While most of central and northern Iraq quickly fell to the rebels in the aftermath of the Mosul takeover, a small unit of Iraqi special forces — since reinforced by a handful of Shiite militiamen — retained control of the central control compound of the Baiji refinery. That left the facility offline but out of the hands of the Islamic State, which has aggressively pursued oil, gas and refinery capability in both Iraq and Syria as a way to fund its nascent caliphate. But the facility being offline has cost the Iraqi government a huge economic price, as it represents nearly 40 percent of the country’s gasoline refinery capability, forcing the import of much more expensive refined products even as Iraq faces by far the worst economic crisis in its modern history.

Although the Iraqi security forces continue to lose significant ground in Sunni-majority western Anbar province, the offensive by government forces into the central province of Salahadin has seen more success, retaking portions of Tikrit, relieving a siege on a major Shiite shrine in Samarra and now, according to officials and local residents, much of Baiji. In contrast, the Islamic State and tribal allies recently have taken over the town of Hit in Anbar, massacring hundreds of uncooperative tribesmen in the last two weeks. The militants also have seized key military bases and significant portions of the provincial capital of Ramadi.

“The army and the Iranian militias have been in the town [of Baiji] for almost a week,” said Abu Ahmed al Baiji, a local resident reached by phone. “[Sunday] night there was a huge battle as the Islamic State attacked them from all sides, but this morning, the army remains.”

Iranian militias are a common description of Iraqi Shiite paramilitary groups used by Sunnis, in reference to their anti-Sunni attitudes and Iranian training and, in some cases, direct Iranian leadership in combat.

Khazal Hamad, a member of the Salahaddin provincial council, said that Iraqi security forces have taken control of most of the town and are preparing to launch an operation to relieve the refinery in the next few days.

“One week ago, the Iraqi army with popular support and local police launched a big attack and made great progress, and they are now inside downtown Baiji,” he said. “Now we control at least three-quarters of the town. But we have small problems that are creating an obstacle to the Iraqi army’s progress. There are roadside bombs, snipers and some car bombs. But they are moving forward and are taking steps to liberate the entire town from Daash,” he added, using the derogatory Arabic acronym for the Islamic State.

“Some of the people inside the town have stopped supporting Daash and, as you know, we can’t judge how powerful Daash is, but these days, they are weakened and they’ve lost many fighters, from leaders and the support that they had,” Hamad said.

While Abu Ahmed said that much of Baiji remains more afraid of the damage from fighting than of the Islamic State itself, even if the residents have concerns about its foreign leadership and ideology.

“We have seen many air attacks on civilians by government helicopters, but the Islamic State has treated us with respect, and many of the fighters are from local tribes,” he said. “We just want peace and an end to the fighting. People don’t care about politics, they want dignity and jobs.”

He added that the advent of the U.S.-led coalition’s airstrikes had reduced the number of Islamic State fighters in the area, leaving behind a majority of local tribal fighters less concerned about the caliphate and more afraid of Shiite-led massacres of the mostly Sunni residents.

The U.S. military announced it had conducted four airstrikes around the town between Sunday and Monday in support of the Iraqi army operation.

“There is no denial that some people gave them support and help, and we feel that some now feel regret for doing that,” Hamad said. “So now we’ve been having meetings between [new Prime Minister] Haidar al-Abadi and some people from Salahuddin. He said he would forgive those who were involved if they’ve not been involved in killing.”

“As you know, the refinery has been under our control from the beginning, and Daash has tried every so often to take control of it but they couldn’t and they can’t,” he said.

Separately, an Iraqi security official, who requested anonymity because he wasn’t authorized to speak to the media, said that the biggest problem is bombs planted on the roads and inside homes, a common tactic used by the Islamic State to halt the advance of poorly trained and equipped Iraqi army soldiers.

The Islamic State, he said, launched an unsuccessful operation at midnight Sunday to try to wrest the downtown from Iraqi security forces.

“They were attacking from four sides, but our security forces and militiamen were ready for it,” the official said. “When the battle was over there were 14 dead bodies from Daash in the streets, and they retreated.”

Iraqi security forces could make more rapid progress but have been exercising restraint in their use of artillery so that they limit the damage to homes, he added.

Never miss a local story.

Sign up today for a free 30 day free trial of unlimited digital access.