A member loyal to the Islamic State in Iraq and the Syria waves an ISIS flag in Raqqa, Syria on June 29, 2014.
September 5, 2014 1:14 PM EDT

One afternoon late last summer I had a tip-off. There was a video on YouTube, uploaded from Syria, and I was in it. A few minutes later, I watched a handful of jihadists open fire with AK-47s on posters of six prominent Danes. One was of NATO Secretary-General Anders Fogh Rasmussen; I was another. A caption appeared: “Enemies of Islam.”

As I studied the video, I recognized one of the gunmen. He called himself Abu Khattab. He had joined a radical Islamist group in Syria, but I knew him from the streets of Copenhagen. He was one of dozens of young Danish Muslims who had gone to fight in Syria, and who had joined the al Qaeda affiliate al Nusra or the Islamic State in Syria and Iraq (ISIS), now in control of huge areas of both Syria and Iraq.

Another clip posted by the same group featured Shiraz Tariq, a Pakistani extremist with whom I had gone paintballing a decade previously in the Danish city of Odense. In those days we had similar views. We believed in jihad against the West; we were Salafis who dreamt of turning places like Yemen and Somalia into Islamic states. We revered Osama bin Laden and sought to justify 9/11.

My fundamentalist interpretation of Islam—the intolerance it bred, the contempt for anyone who did not share what I believed to be the orthodox Islamic point of view—collapsed late in 2006. I simply could not justify the targeting of civilians and was troubled by what I saw as contradictions in Islam that no silver-tongued cleric could explain. My crisis of faith led me to work for no fewer than four Western intelligence agencies—against the very people with whom I had prayed and discussed the Koran.

But Abu Khattab, Shiraz Tariq and many others I had met during my radical years traveled in the other direction, moving from radical thought to violent action. I had known shoe-bomber Richard Reid and the “20th hijacker” Zacarias Moussaoui. I had become a friend of Anwar al-Awlaki, the Yemeni-American cleric whose lectures and writing had galvanized a new generation of would-be jihadists and who was eventually killed by a U.S. drone.

The path to militancy among most of my friends—whether born Muslims or converts to Islam—was often similar: discrimination, a sense of rejection and then vulnerability to a simple and seductive message that offered discipline, comradeship and purpose. There were plenty of clerics capable of delivering that message. There was also rage about the U.S. invasions of Afghanistan and Iraq and Russia’s brutal campaign against the Chechens.

I converted to Islam after reading a book about the Prophet Mohammed in a public library in Denmark. As a wayward 21-year old with several spells in jail behind me, the religion provided structure and purpose. The Prophet prescribed for every eventuality; the idea of free will didn’t seem to matter any more.

Now the Internet is often the recruiting sergeant, with jihadi chat-rooms and slick online magazines and videos in several languages posted on extremist websites. ISIS has mastered the art of propaganda like no other group with its online English-language magazine Dabiq, almost daily videos of its fighters in action and its social programs.

In declaring a Caliphate in much of Syria and Iraq and showing just how merciless it will be to apostates, whether an American journalist, Syrian soldiers or fleeing Yazidis, ISIS is luring would-be jihadists the world over. They are mainly young men who celebrate the grotesque punishments meted out to enemies, are unmoved by the savage treatment of women and enticed by a warped vision of the Promised Land.

They are told it is their duty to fight the unbelievers. “And fight them until there is no more Fitnah [worshipping others besides Allah] and the religion will all be for Allah Alone [in the whole of the world],” in the words of the Koran. I remember Anwar al-Awlaki repeating that verse to a study group we had in Yemen in 2006, to justify jihad in pursuit of the Caliphate.

Of the thousands of foreign fighters who have flocked to Syria and Iraq, a few come home, shattered by the brutality. Others become suicide bombers or are killed on the battlefield. One Dane I had befriended in Yemen was killed fighting in Syria last year. A British-Pakistani I knew from the UK became Britain’s first suicide bomber in Syria.

Many more are learning skills they may one day use to terrorize Europe and even the U.S. Two-hundred and fifty have returned to the UK alone, prompting British authorities last week to ratchet up the terrorist threat level. There is immediate danger from lone wolves angered by U.S. strikes against ISIS. When terrorists act alone, it’s extremely difficult to stop them. As a double agent on the inside, I stopped two such plots being hatched in the UK after the lone-terrorist in each case confided their plans to me. But you can’t get lucky every time.

I have seen some of these men embrace martyrdom; many others have been consumed by the belief that there is only one true path and any dissenting view must be exterminated.

I know this mindset. After the Syria video was posted, Abu Khattab explained why I deserved death. “His task was to kill our beloved Sheikh Anwar al-Awlaki,” he said. Then I received a message from another Danish militant I knew who had been jailed for his part in a terror plot but had been freed and was living in Copenhagen.

“How’s the family? Everyone hates you. Everyone wants you dead,” it said.

Morten Storm is a former double agent inside al Qaeda employed by the CIA, MI6, MI5 and Danish intelligence. His memoir, Agent Storm: My Life Inside al Qaeda and the CIA, co-authored with Paul Cruickshank and Tim Lister and published in September, tells the story of how he led the CIA to American al Qaeda cleric Anwar al-Awlaki.

More Must-Read Stories From TIME

Contact us at letters@time.com.

Read More From TIME
You May Also Like