Many years ago in Cairo I was giving a talk to graduate students and some of their professors at Al Azhar – the pre-eminent centre of Islamic studies and the oldest university in the world. In the discussion period, one of the students said something about “the worldwide mission of Islam”. He was very earnest, and in a typically English way I thought I would lighten the tone: “You seem to be talking about a restoration of the Caliphate!” I intended it as a sort of joke – a reductio ad absurdum of what he had been saying, because at that time I had never heard of anyone who entertained a scheme as visionary as reviving something that the Turks had got rid of early in the 20th century, and which in its Arab version had ceased to exist centuries before that. The young man put his hand on his breast, and said with a solemn intensity: “That is the dearest wish in the hearts of all of us!”.

But now everyone knows that a Caliphate is the declared ambition of Isis in Iraq and Syria. They have even appointed their Caliph. The “dearest wish” in the hearts of those students has just expressed itself in a beheading in France, suicide bombs in Kuwait, and the mass murder of British tourists on a beach in Tunisia. Mr Cameron has depicted sympathy for a Caliphate as part of the narrative of extremism.

Last week the Today programme asked some British Muslims why so many of their community are going to Syria to fight. The usual answers came – they are brainwashed, or groomed, or they have no real understanding of Islam. One old man said simply that he could not imagine why three mothers could abandon their husbands and take their nine children to a war zone. Other explanations have been offered – these young men go for sex, for money, for sadism. There have even been bizarre attempts to blame the British police for radicalising some of them.

The bafflement strikes me as absurd. What is the mystery? When my lame attempt at humour in Al Azhar fell flat I realised that certain ideas had never died. For the Caliphate had existed as long as Islam itself. That Muslims throughout the world form a single community – an Umma – is not the conviction of a few cranks. It is inherent in all Muslim traditions. Even if the divisions within the Arab world make a Caliphate seem impossible to achieve, very many Muslims – perhaps the majority throughout the world – respond to it instinctively as an ideal. A leader who with God’s blessing dispenses law and justice throughout the countries of Islam appeals as profoundly to the Muslim imagination as the kingdom of Christ upon earth or St Augustine’s City of God did to Christians in Europe for at least 1,500 years. In England in the 17th century, Protestant radicals thought that they were achieving just that.

Timeline: The emergence of Isis Show all 40 1 /40 Timeline: The emergence of Isis Timeline: The emergence of Isis 2000 Abu Musab al-Zarqawi (pictured here) forms an al-Qaeda splinter group in Iraq, al-Qa’eda in Iraq. Its brutality from the beginning alienates Iraqis and many al-Qaeda leaders. Timeline: The emergence of Isis 2006 Al-Zarqawi is killed in a U.S. strike. Al-Zarqawi’s successor, Abu Ayyub al-Masri, announces the creation of the Islamic State in Iraq (ISI). Reuters Timeline: The emergence of Isis 2009 Still al-Qaeda-linked ISI claims responsibility for suicide bombings that killed 155 in Baghdad, as well as attacks in August and October killing 240, as President Obama announces troop withdrawal from Iraq in March. Getty Images Timeline: The emergence of Isis 2010 Abu Bakr al-Baghdadi becomes head of ISI, at lowest ebb of Islamist militancy in Iraq, which sees last U.S. combat brigade depart. Timeline: The emergence of Isis 2012 In Syria, protests (pictured here starting in Daree) have morphed into what president Assad labelled a “real war” with emergence of a coalition of forces opposed to Assad’s regime. Syria group Jabhat al-Nusra are among rebel groups who refuse to join, denouncing it as a “conspiracy”. Bombings targeting Shia areas, killing more than 500 people, spark fears of new sectarian conflict. Sunni Muslims stage protests across country against what they see as increasingly marginalisation by Shia-led government. AP Timeline: The emergence of Isis 2013 Al-Baghdadi renames ISI as the Islamic State in Iraq and Syria, or Isis, as the group absorbs Syrian al-Nusra, gaining a foothold in Syria. In response, al-Qaeda chief Ayman al-Zawahiri (Bin Laden’s successor) concerned about Isis’ expansion orders that Isis be dissolved and ISI operations should be confined to Iraq. This order is rejected by al-Baghdadi. AFP Timeline: The emergence of Isis 2014 - January Isis fighters capture the Iraqi cities of Fallujah and Ramadi, giving them base to launch slew of attacks further south. AP Timeline: The emergence of Isis 2014 - June Isis declares itself the Caliphate, calling itself Islamic State (IS). The group captures Mosul, Iraq’s second largest city; Tal Afar, just 93 miles from Syrian border; and the central Iraqi city of Tikrit. These advances sent shockwaves around the world. Timeline: The emergence of Isis 2014 - June Around the same time Isis releases a video calling for western Muslims to join the Caliphate and fight, prompting new evaluations of extremists groups social media understanding. Timeline: The emergence of Isis 2014 - June Isis take Baiji oil fields in Iraq - giving them access to huge amounts of possible revenue. EPA Timeline: The emergence of Isis 2014 - August James Foley is executed by the group as concerns grow for second American prisoner, fellow reporter Steven Sotloff. AP Timeline: The emergence of Isis 2014 - August Obama authorises U.S. airstrikes in Iraq, helping to stall Isis’ along with action by Kurdish forces following the deaths of hundreds of Yazidi people on Mount Sinjar. Timeline: The emergence of Isis 2014 - September Isis release video showing Steven Sotloff’s murder prompting Western speculation his executioner is same man who killed Mr Foley. EPA Timeline: The emergence of Isis 2014 - September Obama tells us that America “will hunt down terrorists who threaten our country” EPA Timeline: The emergence of Isis 2014 - September Isis release a video appearing to show David Haines, who was captured by militants in Syria in 2013, wearing an orange jumpsuit and kneeling in the desert while he reads a pre-prepared script. It later shows what appears to be the aid worker's body. Rex Timeline: The emergence of Isis 2014 - September Peshmerga fighters scrabble to hold positions in the Diyala province (a gateway to Baghdad) as Isis fighters continue to advance on Iraqi capital. AFP Timeline: The emergence of Isis 2014 - October Aid worker Alan Henning is killed. Self-imposed media blackout refuses to show images of him in final moments, instead focuses upon humanitarian care. AP Timeline: The emergence of Isis 2014 - October Isis raise their flag in Kobani, which had been strongly defended by Kurdish troops. The victory goes against hopeful western analysis Isis had overextended itself, while alienating much of the Muslim population through the murder of Henning. Victory causes fresh waves of Kurdish refugees arriving in Turkey. Timeline: The emergence of Isis 2014 - November American hostage, who embarced values of Islam, Peter Kassig and 14 Syrian soldiers are shown meeting the same fate as other captives. But intelligence agencies will be poring over the apparently significant discrepancies between this and previous films. Seramedig.org.uk Timeline: The emergence of Isis 2015 - February Isis has released a video revealing the murder by burning to death of a Jordanian pilot held by the group since the end of December 2014. Reuters Timeline: The emergence of Isis 2015 - February Isis militants have released videos which appear to show the beheading of Japanese hostages Haruna Yukawa and Kenji Goto. Timeline: The emergence of Isis 2015 - February American aid worker, Kayla Mueller was the last American hostage known to be held by Isis. She died, according to her captors, in an airstrike by the Jordanian air force on the city of Raqqa in Syria, though US authorities disputed this. AP Timeline: The emergence of Isis 2015 - February Isis militants have posted a gruesome video online in which they force 21 Egyptian Coptic Christian hostages to kneel on a beach in Libya before beheading them. Egypt vowed to avenge the beheading and launched air strikes on Isis positions. AP Timeline: The emergence of Isis 2015 - February The British Isis militant suspected of appearing in videos showing the beheading of Western hostages has been named in reports as Mohammed Emwazi from London. Rex Features Timeline: The emergence of Isis 2015 - March Isis triple suicide attack has killed more than 100 worshippers and hundreds of others were injured after the group members targeted two mosques in the Yemeni capital of Sanaa. AP Timeline: The emergence of Isis 2015 - April Iraqi forces have claimed victory over Isis in battle for Tikrit and raised the flag in the city. EPA/STR Timeline: The emergence of Isis 2015 - April Isis has claimed responsibility for a suicide bomb attack in Afghanistan that killed at least 35 people queuing to collect their wages and injured 100 more. EPA Timeline: The emergence of Isis 2015 - April Isis’ media arm released a 29-minute video purporting to show militants executing Ethiopian Christians captives. The footage bore the extremist group’s al-Furqan media logo and showed the destruction of churches and desecration of religious symbols. A masked fighter made a statement threatening Christians who did not convert to Islam or pay a special tax. Timeline: The emergence of Isis 2015 - May Abu Bakr al-Baghdadi, the leader of Isis has been "incapacitated" by a spinal injuries sustained in a US air strike in Iraq. He is being treated in a hideout by two doctors from Isis’ stronghold of Mosul who are said to be "strong ideological supporters of the group". Timeline: The emergence of Isis 2015 - May Isis has also claimed responsibility for killing 300 of Yazidi captives, including women, children and elderly people in Iraq AP Timeline: The emergence of Isis 2015 - May Isis attack on Prophet Mohamed cartoon contest in Texas was its first action on US soil. Two gunmen were shot and killed after launching the attack at the exhibition. Elton Simpson and Nadir Soofi have been named as the attackers at the Curtis Culwell Centre arena in Garland. Timeline: The emergence of Isis 2015 - May Isis’s deputy leader, Abu Alaa Afri, a former physics teacher who was thought to have taken charge of the deadly terrorist group, has been killed in a US-led coalition airstrike. Timeline: The emergence of Isis 2015 - May US special forces have killed a senior Isis leader named as Abu Sayyaf in an operation aiming to capture him and his wife in Syria. Getty Images Timeline: The emergence of Isis 2015 - May Iran-backed militias are sent to Ramadi by the Iraqi government to fight Isis militants who completed their capture of the city. Government soldiers and civilians were reportedly massacred by extremists as they took control and the army fled. Charred bodies were left littering the city streets as troops clung on to trucks speeding away from the city. Ramadi is the latest government stronghold to fall to the so-called Islamic State, despite air strikes by a US-led international coalition aiming to stop its advance in Iraq and Syria. AFP Timeline: The emergence of Isis 2015 - May Isis rounded up civilians trapped in Palmyra and forced them to watch 20 people being executed in the historic city’s ancient amphitheatre. The Unesco World Heritage site was overrun by militants, threatening the future of 2,000 year-old monuments and ruins. Thousands of Palmyra’s residents fled but many are still living within the city walls, while the UN human rights office in Geneva said it had received reports of Syrian government forces preventing people from leaving until they retreated from the city. Getty Timeline: The emergence of Isis 2015 - May A group of Isis-affiliated fighters have captured a key airport in central Libya. The militants took control of the al-Qardabiya airbase in Sirte after a local militia tasked with defending the facility withdrew from their positions. Affiliates of Isis, already control large parts of Sirte, the birthplace of former Libyan leader Muammar Gaddafi and a former stronghold of his supporters. Timeline: The emergence of Isis 2015 - June The US Air Force has destroyed an Isis stronghold after an extremist let slip their location on social media. According the Air Force Times, General Herbert "Hawk" Carlisle, commander of Air Combat Command, said that Airmen at Hulburt Field, Florida, used images shared by jihadists to track the location of their headquarters before destroying it in an airstrike. Reuters Timeline: The emergence of Isis 2015 - June Kurdish forces captured a key military base in a significant victory in Raqqa as well as town of Tell Abyad. YPG fighters, backed by US-led airstrikes and other rebels, consolidated their gains, when they seized the key town on the Syria-Turkey border. They are now just 30 miles to the north of Raqqa and have cut off a major supply route deep inside Isis-held territory. Ahmet Silk/Getty Timeline: The emergence of Isis 2015 - June Isis has released gruesome footage claiming to show the murder of more than a dozen men by drowning, decapitation and using a rocket-propelled grenade as it seeks to boost morale among its fanatical supporters. Timeline: The emergence of Isis 2015 - June Isis has begun carrying out its threat to destroy structures in the ancient Syrian city of Palmyra, blowing up at least two monuments at the Unesco-protected site as Syrian government troops made advances on the Islamist’s positions. AFP

Think what led tens of thousands to join the Crusades to the Holy Land, and prompted popes of the time to promise that all who died for the cause would go straight to heaven as martyrs. The idea was to get back the once Christian territories that had been lost to the Muslims, and especially to recover the Holy Sepulchre. The Crusaders committed atrocities on the way pretty much comparable to the barbarities of Isis – and when finally they captured Jerusalem, they slaughtered 70,000 Muslims, so that they waded knee-deep in blood, and burned the Jews in their synagogue.

As irrational ideas go, I would say the Caliphate is a bit less mad than killing tens of thousands in order to regain the burial place of Christ. To remedy the disunity imposed on the Arab world by such tricks as the Sykes-Picot pact after the First World War – which created Syria and Iraq purely to serve the purposes of the British and French – is not in itself a mad ambition.

Pan-Arab nationalists after the Second World War all went for a secular version of a Caliphate. Gamal Abdel Nasser proclaimed a union of Egypt and Syria, aimed to add Iraq, invaded Yemen, and meddled throughout the Arab world.

So you can understand why young men can be dazzled by the idea of a Caliphate – by something that claims to embody ancient ideals and to avenge recent humiliations. Of course there has been a terrible descent over the years from the exquisitely courteous young men to whom I talked at Al Azhar, through the simple-minded and cruel Taliban, the even more vicious al-Qaeda, to the unspeakable sadism of Isis.

Thousands were prompted to join the Crusades to the Holy Land; ,the idea being to get back the once Christian territories that had been lost to the Muslims (Getty)

But none of this has to start in cruelty or madness – even though it seems usually to end up that way. And it is no good our professing that we cannot understand any of it – safe in the knowledge that we got rid of this sort of thing in the 17th century, if not in the 12th.

Nostalgia is a normal temptation – from the Greeks’ idea that they have some connection with the Athens of Pericles in the fifth century BC, and that therefore they should have the Elgin Marbles back, to the late Shah of Iran’s hope that he could restore the glories of the ancient Achaemenid empire, to the hopeless attempt by Irish nationalists to revive Gaelic as the language of Ireland. I have talked to Mullahs in Iran who said that they had waited 1,500 years to get their clerical state, and to Sufis in Aleppo who wanted to give Saudi Arabia back to the family of the Prophet.

But the vital thing is that these Isis barbarians actually have a nucleus of a functioning empire – huge swathes of Iraq and Syria, quantities of modern heavy armour abandoned by the Iraqi army, vast amounts of money looted from banks and – until the Americans began bombing them – conquered oil fields.

I would guess that many of the young who go to Syria think of themselves as pioneers building a utopia – even though they end up “learning love of slaughter”.

Isis needs to be destroyed. But Mr Cameron is right in supposing that this utopianism is something that not a few of their co-religionists condone without facing any of the consequences of trying to put it into effect.