THERE is no cause yet for cheer, but for the first time since last summer’s blitzkrieg by Islamic State (IS) the news from Iraq and Syria has been less than uniformly grim. General Martin Dempsey, America’s chairman of the joint chiefs of staff, on November 15th told American troops in Iraq that the battle is “starting to turn”— though it will take time to defeat the jihadists. The UN’s envoy for Iraq, Nickolay Mladenov, assured the Security Council that the strategy of enlisting local forces was showing signs of progress. “We’re not looking at the collapse of the Iraqi state,” he said. “We’ve turned the tide.”

After months of setbacks the wobbly American-led coalition battling IS has halted the group’s momentum and begun to seize the initiative. Relentless air attacks have depleted the group’s arsenals, reduced its mobility and reportedly killed several of its senior commanders. The coalition’s campaign has grown in scope and sophistication. A single raid on November 19th, targeting a complex of IS fortifications north-west of Kirkuk, involved aircraft from seven countries.

There is movement on the ground, too. On November 14th Iraqi government forces scored their most hopeful battlefield advance to date: the recapture of the giant oil refinery at Baiji, a town along the Tigris river between the Iraqi capital, Baghdad, and its rebel-held second city, Mosul. The success not only returned a big economic asset to government hands, but also severed the link between a pocket of IS forces in Tikrit and a larger zone under its sway to the north. Kurdish and Iraqi government forces and allied militias are said to be poised for an offensive from the east into this area. Tikrit, largely abandoned by its people, may not stay long in IS hands.

Iraq’s internal politics may also be less poisonous than before. Unlike its narrow-mindedly pro-Shia predecessor, the government of Haider al-Abadi has made an effort to win over the minority Sunnis, whose anger at being marginalised fuelled IS’s rise. It has also acted to heal rifts with the Kurds’ autonomous region, transferring an initial $500m tranche of federal funds that had been withheld by Baghdad in protest against Kurdish efforts to exploit their own oil resources. This improving political climate should foster closer military co-operation between the Kurds and the central government, and raises the chance that more Sunni tribes can be coaxed onto the government’s side in a repeat of America’s belated but ultimately successful effort to subdue restless Sunni regions during its occupation of Iraq.

Coalition bombing in Syria, meanwhile, has sharply reduced the flow of contraband oil, a big source of IS funding. It has also halted IS’s two-month-long offensive against the Kurdish-controlled town of Kobane (also known as Ayn al-Arab). Local Syrian Kurdish forces, now reinforced by other Syrian rebels and Peshmerga troops supplied by Iraqi Kurdistan, are slowly pushing IS fighters out of the besieged city. The jihadists have paid a heavy price. On November 16th the Syrian Observatory for Human Rights, a British-based monitoring group, put IS losses at over 700 dead and the Kurds’ at fewer than 400.

That said, while a winning strategy in Iraq seems to be in sight, the same is not true of Syria, where there are few ground forces to take on IS. The policy of focusing only on IS (and at times on another jihadist group, Jabhat al-Nusra), while leaving President Bashar Assad undisturbed, risks weakening mainstream rebels and causing a dangerous Sunni backlash.

For now, faced with worsening odds in battle, IS has responded with more intense propaganda. Countering rumours that he had been injured or killed, the IS “caliph”, Abu Bakr al-Baghdadi, vowed on November 13th in a rare recorded speech that his men would fight to the death. A later IS propaganda video showcased the group’s gore, including carefully choreographed slow-motion close-ups of the beheading of 18 captured Syrian air force officers (see picture) and the purportedly severed head of an American ex-soldier turned aid worker, Peter Kassig. IS’s unflinching killers included several Western recruits.

The videos sought to project terror by suggesting the widening reach of IS. “We will begin to slaughter your people on your streets,” warned a masked fighter in one scene; a map in another showed IS’s black flag unfurling across the region to the sound of recordings by Islamist rebel leaders in Algeria, Egypt, Libya and elsewhere, declaring allegiance to the caliphate. Mr Baghdadi stressed his mission’s pan-Islamic nature by calling on Sunnis in Yemen and in “the Land of the Sanctuaries”, ie, Saudi Arabia, to kill Shias in their midst.

Such savage fanaticism may have a limited audience. Masked gunmen, probably inspired by similar views, did in fact kill five Shia worshippers in Saudi Arabia on November 4th. But the attack, as well as IS’s own actions, has generated public revulsion rather than admiration. Fear of IS has also spurred Gulf states on November 16th to end a bitter dispute between Qatar and its neighbours over the small emirate’s alleged support for Islamist groups. Whatever its claims, IS is generating enemies faster than friends.