THE fate of a small rural town in northern Syria might seem inconsequential when faced with a multinational assault on the group’s main stronghold, Mosul. But few places were more central to the image of Islamic State (IS). The jihadists lauded Dabiq as the locus, as cited in an obscure Hadith, or saying of the Prophet Muhammad, of the battle of the end of days; in their vision it would be the site of an apocalyptic showdown between the self-styled caliphate’s faithful and Western crusaders. It named its glossy English-language e-zine after the town, and beheaded its victims, including Peter Kassig, an American aid worker, in its foothills. As the day of reckoning approached, observers reported that IS had fortified Dabiq with 1,200 fighters.

In the end, IS went with barely a whimper. The jihadists folded before the advance of Turkish-backed rivals after just a day’s battle. IS’s “caliph”, Abu Bakr al-Baghdadi, had foretold of the capitulation in a dream, explained apologists. IS’s propagandists even pre-empted the fall with the launch of a new English title, Rumiya, deferring the end-of-days battle until IS reaches Rome.

IS’s eschatology—the theology of death, judgment and the end of the world—has always been flexible. Experts see it more as a recruitment tool than a tenet of faith. “Opportunistic apocalypticism,” is what one French scholar, Jean-Pierre Filiu, has called it. Mr Baghdadi seemed more interested in state-building than doomsday. He called himself caliph, an earthly ruler, rather than a mythological mahdi, or messiah. But theological hype helped whip up impressionable Muslims abroad, like Mohammed Emwazi, a London dropout who executed Mr Kassig and others. “Apocalyptic motifs helped recruit people unfamiliar with the tradition. Europeans fit into that category,” says David Cook, an American professor and author of “Contemporary Muslim Apocalyptic Literature”. In the words of Ibn Khaldoun, classical Islam’s greatest and most cynical historian, “The Arabs obtain power only by relying on a religious movement.”

Traditionally, Sunni Islam—the dominant sect—sought to prop up the world order. The notion of upending it was a Shia belief, offering Islam’s battered minority a hope of redemption. At the appointed hour, their 12th imam, who disappeared in 941 to avoid the persecution Sunni despots had inflicted on his 11 predecessors (pictured below), would return as al-mahdi al-muntadhar, “the awaited saviour”, and vanquish the oppressors.

But during this century Sunnis have come to see the world differently. Western armies upturned the old order of Islam’s Iraqi heartland, replacing Sunni masters (a minority) with non-Sunni ones (the Shia majority). Sunni confidence has turned to despair. Jihadists like al-Qaeda had scant time for the apocalyptic, but as successive waves of jihad floundered and the Sunni lot worsened, some Sunnis adopted some of Shia Islam’s more fantastical thinking. “Millennial traits were always there in Sunni Islam but undeveloped in any great detail,” says Robert Gleave of Exeter University. After America killed Abu Musab al-Zarqawi, al-Qaeda’s leader in Iraq, in 2006, and put his jihadists to rout, a despondent remnant unearthed references buried in canonical compilations of Muhammad’s sayings. They turned up alamat al-saa, “signs of the hour”, including the race to construct sky-high buildings, the rising of the sun in the west and an army brandishing black banners in the east—all signs that Zarqawi’s devotees claimed to discern. Accompanying the mahdi, Jesus would return, they claimed, bearing a bloody lance.

By contrast, as Iraq’s Shias grew accustomed to power, their own apocalyptic impulse waned. “When we suffered, we prayed for the imam,” says a taxi driver in Baghdad’s teeming Shia shantytown, Sadr City. “Now that victory is here, we’ve forgotten him.” In Iran, laymen and low-level clerics have still found the notion of apocalypse useful in taking on establishment clerics. When challenged by ayatollahs, Mahmoud Ahmadinejad, the Islamic Republic’s ex-president and the only layman to have held the job, would convene his cabinet in Jamkaran, one of the bling-emblazoned sites where the 12th imam is expected to return. But on the whole, Shias have tempered their talk of extra-worldly deliverance. Even Muqtada al-Sadr, a lowly but firebrand Iraqi cleric, renamed his Mahdi Army the Brigades of Peace.

Now that Dabiq has failed to deliver, might jihadists ditch their more nihilistic ideas? Precedent suggests that, for some, failure will only redouble their flights of fancy. But from the pavements of Cairo to Karbala, Mr Cook detects a decline in apocalyptic publications. Under tighter surveillance, the more hysterical might have gone underground or found a home on the deep web. But many Sunni Iraqis are as appalled by IS’s brutality as anyone else. Preachers in Baghdad say a new realism is taking hold. Better, perhaps, that the appointed hour is postponed.