Ever since I started meeting jihadis, I have been struck by one thing – their Britishness. I am from the East End of London, and at some point in the past decade I became used to hearing a hoarse and angry whisper of jihadism on the streets where I live. Bearded young men stand outside the library calling for "The Rule of God" and "Death to Democracy".

In the mosques across the city, I hear a fringe of young men talk dreamily of flocking to Afghanistan to "resist". Yet this whisper never has an immigrant accent. It shares my pronunciations, my cultural references, and my national anthem. Beneath the beards and the burqas, there is an English voice.

The East End is a cramped grey maze of council estates, squashed between the glistening palaces of the City to one side and the glass towers of Docklands to the other. You can feel the financial elites staring across at each other, indifferent to this concrete lump of poverty dumped in-between by the forgotten tides of history. This place has always been the swirling first stop for immigrants to this country like my father – a place where new arrivals can huddle together as they adjust to the cold rain and lukewarm liberalism of Britain.

Download the new Independent Premium app Sharing the full story, not just the headlines

The Muslims who arrive here every day from Bangladesh, or India, or Somalia say they find the presence of British Islamists bizarre. They have come here to work and raise their children in stability and escape people like them. No: these Islamists are British-born. They make up 7 per cent of the British Muslim population, according to a Populous poll (with the other 93 percent of Muslims disagreeing). Ever since the 7/7 suicide bombings, carried out by young Englishmen against London, the British have been squinting at this minority of the minority and trying to figure out how we incubated a very English jihadism.

But every attempt I have made up to now to get into their heads – including talking to Islamists for weeks at their most notorious London hub, Finsbury Park mosque, immediately after 9/11 – left me feeling like a journalistic failure. These young men speak to outsiders in a dense and impenetrable code of Koranic quotes and surly jibes at both the foreign policy crimes of our Government and the freedom of women and gays. Any attempt to dig into their psychology – to ask honestly how this swirl of thoughts led them to believe suicide bombing their own city is right – is always met with a resistant sneer, and yet more opaque recitations from the Koran. Their message is simple: we don't do psychology or sociology. We do Allah, and Allah alone. Why do you have this particular reading of the Koran, when most Muslims don't? Because we are right, and they are infidel. Full stop. It was an investigatory dead end.

But then, a year ago, I began to hear about a fragile new movement that could just hold the answers we journalists have failed to find up to now. A wave of young British Islamists who trained to fight – who cheered as their friends bombed this country – have recanted. Now they are using everything they learned on the inside, to stop the jihad.

Seventeen former radical Islamists have "come out" in the past 12 months and have begun to fight back. Would they be able to tell me the reasons that pulled them into jihadism, and out again? Could they be the key to understanding – and defusing – Western jihadism? I have spent three months exploring their world and befriending their leading figures. Their story sprawls from forgotten English seaside towns to the jails of Egypt's dictatorship and the icy mountains of Afghanistan – and back again.

I. The Imam

My journey began when, sitting in one of the grotty greasy spoon cafés that fill the East End, I heard a young woman in hijab mention that the imam of one of the local mosques was a jihadi who had fought in Afghanistan, but is now facing death threats from the very men he once fought alongside. His "crime"? To renounce his past and call for "a secular Islam".

After a series of phone calls, Usama Hassan cautiously agrees to talk. I meet him outside his little mosque in Leyton. It sits in the middle of a run-down sprawl of pound stores ("Everything only £1!!!"), halal kebab shops, and boarded-up windows at the edge of the East End.

Usama is a big, broad bear of a man in a black blazer and wire-rimmed glasses. He greets me with a hefty handshake; he has a rolled-up newspaper under his arm. He takes me upstairs to a pale-green prayer room. This building was once a factory, then a cinema; now, with Saudi money, it is a Wahabi mosque. Men are kneeling silently towards Mecca, rising and bending in reverential waves. "On Fridays, there are Islamists who stand outside and warn worshippers that their prayers won't count if they are led by me," he says as we squat in the corner, "because I'm supposedly an apostate. A fake imam." He looks away. "I get phone calls late at night. Threats. It's painful. You see, I was like them once."

And so Usama begins to tell me his story. He arrived in Tottenham in North London in the mid- 1970s, when he was five years old. His Pakistani father was sent here by the Saudi Ministry of Religious Affairs, which aims to spread its puritan desert strain of Islam to every nation. His family led a locked-down life, trying to adhere to Saudi principles in a semi-detached house in the English suburbs. "We weren't allowed music or TV or any contact with the opposite sex," he says. "We were very sheltered. I didn't go out a great deal." By the age of 10, he had memorised every word of the Koran in its original Arabic.

He had a strong sense of the Britain beyond his walls – the Britain where I was growing up – as a hostile, violent place. "You have to understand – it was the time of the Tottenham riots. It felt violent in the streets," he says. "I got used to expecting white people to use the Paki word. We used to have a fear of skinheads the whole time."

But Usama was offered a scholarship to the heart of the English elite – the City of London Boys' School, where he could practice cricket at Lord's. He bonded with the Jews at the school as outsiders and supporters of Tottenham Hotspur football team. He still speaks like the public schoolboy he was – in long, confident sentences.

Some berobed men are staring at us, so he takes me down to the mosque's office. "At that time, being a Muslim meant being an Islamist. It was taken for granted," he says. So when he was 13, he joined an Islamic fundamentalist organisation called Jimas. At big sociable conferences every weekend, they were told: you don't feel at home in Britain, but you can't go "home" to a country you have never visited. So we have a third identity for you – a pan-national Islamism that knows no boundaries and can envelop you entirely.

It sounds familiar. This is the identity I hear shouted by young Islamists throughout the East End: I might sound like you, but I am nothing like you. I am Other. I belong elsewhere – in a place that does not yet exist, but that I will create, with my fists and my fury.

Jimas told their members they were part of a persecuted billion, being blown up and locked down across the world. "It was a bit like a gang," he says. "And we had a strong sense of being under siege. It was all a conspiracy against Islam, and we were the guardians of Islam. That's how we saw ourselves ... A lot of my friends would wear the army boots, and carry knives." I realise now that for a nebbish intellectual boy, it must have felt intoxicating to be told he was part of a military movement that would inevitably conquer history.

For his summer vacation in 1990 – as a break from studying physics at Cambridge University – he went to wage jihad on the battlefields of Afghanistan. He arrived with two friends from Jimas at an Arab-run training camp in the mountains of Kunar in Eastern Afghanistan. It was a sparse collection of tents and weapons left behind by the CIA in the snow and blood. They spent the days running up and down mountains learning how to fire Kalashnikovs and rocket launchers. "When you fire a Kalashnikov, it echoes all around the mountain," he says. "After this boring life, you feel the adrenaline pumping."

The Arab fighters wore four layers of clothes and still shivered. They had never seen snow before, so every now and then, they would lay down their weapons to have a long, gleeful snow-fight. Once they had all learned how to kill, they were taken to the front line to shell the communist hold-outs. "One of the shells landed very close to us, about 100ft away." He fired in retaliation. "I hope we never killed anybody," he says quickly.

Usama tells his story fluently and fast, and rides over these difficult moments – a killing – like a speed-bump. He thought an earthly paradise would rise from the rubble he was creating – and remake the world in its image. "The expectation was that Afghanistan would become this dream Islamic state," he adds, "which would then spread all over the world." He returned to Cambridge University determined to convert as many of his fellow Muslim students as possible to Wahabism. "It was relatively easy to persuade them," he says. "People were looking for group identity. They were very confused: what does it mean to live as a Muslim in society like this? We had easy answers. Go back to the original sources, and [follow it] literally."

At the centre of this vision was the need to rebuild the caliphate – the Islamic state under sharia law persisted from the time of Mohamed until 1924. "It was a very dreamy, romantic idea," he says. "If anybody asked questions about how it would work, we would just say – the people that will make it happen will be so saintly, they will make the right decisions." It was the old promise of the revolutionary down the ages: there would be a single revolutionary heave in which all political conflict would dissolve forever, and a conflict-free paradise would be born.

Usama's job was to persuade people to go to fight in Afghanistan and, from the mid-1990s, Bosnia. He was one of the best – and he says, again very fast, that one of his successes was to radicalise Omar Sheikh, the man now on death row in Pakistan for beheading Daniel Pearl. "I set him off on his path to Jihad," he says. He looks a little excited, and a little appalled. The first thing he remembers about Sheikh – who he met at a Jimas study circle – is the fresh lemonade he made in his university rooms. "It was delicious. And we drank and drank. My first impression of him was that he was a clean-shaven, well-educated British public schoolboy. A lovely bloke."

Sheikh was furious about the massacres of Muslims in Bosnia, and demanded the study group lay down their Koranic debates and act. Usama told him: "If you're really serious, you can go and fight. I know people who have gone and fought. I can introduce you to them." And so his journey to torturing and murdering a Jewish journalist – simply because he was a Jew – began.

Usama doesn't want to talk about him any more: he changes the subject, and I have to bring him back to it. "Nothing is proved against him. He's fighting extradition," he says, after a long pause. "But ... " He has an awkward smile. An embarrassed smile. He quickly carries on speaking, ushering us away from Daniel Pearl.

People come in and out of the mosque office, and Usama lowers his voice a little. He says that as he was persuading young men to go and kill, he noticed something disconcerting: the Afghan mujahedin he had fought for were not building a paradise on earth after all. Instead, they were merrily slaying each other. "This great, glorious Islamic revolution – it didn't happen, at all ... they just killed each other."

As he watched the news of the Luxor massacre in Egypt or Hamas suicide-bombings of pizzerias in Tel Aviv, "It just became more and more difficult to justify that." He found himself thinking about the Jewish friends he had made at school. "They were just like me – human beings. And we had a lot in common. The dietary laws, and the identity issues, and the fear of racism." As he heard the growing Islamist chants at demonstrations – "The Jews are the enemy of God," they yelled – something, he says, began to sag inside him.

The stifled language Usama is using to describe his past reminds me of a recovering alcoholic trying to piece together his fragmented memories and understand who he was. When he talks about anti-Semitism, he is clearly ashamed; he giggles almost randomly, looks away, and looks back at me with a puckered, disgusted look.

We have talked enough; we arrange to meet again. The second time I see him, in a café, he seems more guarded, as if he revealed too much. He shifts the conversation onto theology – the area where, I discover, every ex-jihadi feels happiest. He says the 7/7 bombings detonated a theological bomb in his mind: "How could this be justified? I began to wonder if parts of the Koran are actually metaphor, and parts of the Koran were actually just revealed for their time: seventh-century Arabia."

Once the foundation stone of literalism was broken, he had to remake the concepts that had led him to Islamism one-by-one. "Jihad has many levels in Islam – you have the internal struggle to be the best person you can be. But all we had been taught is military jihad. Today I regard any kind of campaigning for truth, for justice, as a type of Jihad." He signed up to the pacifist Movement for the Abolition of War. He redefined martyrdom as anybody who died in an honourable cause. "There were martyrs on 9/11," he says. "They were the firefighters – not the hijackers."

He says he found himself making arguments he once thought unthinkable – like arguing that women should be allowed to show their hair in public. Jihadi websites run by his old friends started to declare him an apostate, a crime that under their interpretation of sharia is punishable by death.

There have been demands that he should be ousted from the mosque, but his father is its founder and chief imam, so he is protected for now. He says – leaning forward, his voice losing its public school composure – that the threats have only made him more sure of the need for reform. He has started to call for Muslims to abandon the "medieval interpretation of the sharia" that calls for the killing of apostates and homosexuals. He has said there should be a two-state solution in the Middle East. He has reached the conclusion that evolution is "a scientific fact".

And for the first time in his life, Usama has begun to allow himself to listen to music. "I was taught to believe it shouldn't be allowed. But now, I listen on the car radio." I ask him what music he likes, and he lets out a high-pitched giggle. "You'll get me killed!" he says. "Everything in the charts." He gives me some names, but then calls later and asks me not to print them: "That would be a step too far."

As the threats against him rattle across the internet, I like to think of this as my last image of Usama – a 39-year-old man slowly slipping off the Puritan chains in which he has been bound and finally, in his fourth decade, beginning to dance, as he is circled by the angry ghosts of his younger self.

II. The Prisoner

The most famous former Islamist fanatic in Britain is Maajid Nawaz – a high-cheekboned 31-year-old who walks with a self-confident strut. I make an appointment with him through his personal assistant, and he strides into the hotel lobby where we have arranged to meet in an immaculate and expensive suit. He seems to blend perfectly into the multi-ethnic overclass who use expensive hotels like this as their base; I have to remind myself with a jolt that, not so long ago, he was caught up in a murder in London, helped to plot a coup in nuclear-tipped Pakistan, and served three years in the most notorious prison in Egypt.

Maajid begins to tell me his story as if he is delivering a PowerPoint presentation. He has offered it before, and he will offer it again; it is his job now. He has distilled it into a script. When I try to poke beneath it with questions, he seems irritated, and returns to the comfortable form of words he has established as soon as he can.

His journey towards Islamism began, he says, at the sandy edge of Essex, in the dilapidated coastal town of Southend-on-Sea. It is an old, elegant Victorian resort town drooping under a century of disrepair, reduced to a smattering of tatty arcades and a long, neglected pier that reaches into a filthy sea. Maajid's parents were mildly prosperous first-generation immigrants from Pakistan. "My upbringing was completely liberal from the start," he says. "In fact, I didn't even have a Muslim identity." He went to mosque only once, when he was 11, and an imam hit him with a stick for speaking too loudly.

Asian families were a rarity there in the 1980s, but he had a large group of white friends and felt no different to them. Yet when Maajid turned 14, a strange political shift was taking place in Southend. It began – for him, at least – one evening when Maajid, his brother and his friends were at the funfair, leaping on and off the rides and eating candy floss. A group of young skinheads spotted them and started making Nazi salutes and shouting "Seig Heil".

Maajid and his mates "ran the hell out of there", but a white van pulled up and seven skinheads piled out, wielding machetes. They cornered Maajid and one of his white friends. To his astonishment, they turned to the friend and stabbed him repeatedly with a carving knife, shrieking: "Traitor! Traitor! Race traitor!" They drove off, leaving Maajid covered in his friend's blood.

The story of what happened next is buried in yellowing cuts from the local newspapers. A pack of unemployed young men who had been kicking around on Southend's beaches had joined the Neo-Nazi group Combat 18, named after Adolf Hitler's initials: A is "1" in the alphabet, H is "8". They targeted Maajid's friends one by one for befriending a "Paki". Over the next two years, three of his friends were stabbed, and one was smashed up with a hammer. Maajid began to distance himself from his white friends, out of guilt. He drifted instead towards a group of young black people who were also being terrorised by Combat 18. They would meet at house parties and marinate themselves in hip-hop, Public Enemy, and cannabis fumes. He says: "Feeling totally rejected by mainstream society, we were looking for an alternative identity, and we found the perfect, cool, fashionable identity through listening to hip-hop and speeches by Malcolm X."

One day, his brother came home bearing a sheath of leaflets saying Muslims were being massacred all over the world, from India to Bosnia to Southend. He had stumbled on a stall in the High Street manned by a group called Hizb ut-Tahrir (HT). They said he would never be accepted in irreparably corrupt, decadent and racist Britain: Combat 18 were the snarl hidden behind every net curtain. Western society was merely a purgatory for Muslims, and the only escape could be to migrate to a renewed and perfect caliphate somewhere in Arabia. He joined up that day.

Maajid climbed the ranks of HT fast, because – with his easy eloquence – he was especially good at recruiting new members. After a year, they sent him to live in London and conquer a sixth form college. Newham College is a sprawling glass-and-concrete school for 16- to 19-year-olds in the most depressed slab of London. There, Maajid found himself in a majority-Muslim environment for the first time. "I was like somebody who has been craving chocolate for a long time who ends up in Belgium. I thought: these are my people. I knew exactly how to manipulate their grievances. And I did it. We took over that college."

We are served tea by the kind of effusive waitress who works in high-end London hotels. Maajid does not acknowledge her. He says it was "unbelievably easy" to recruit young Muslims to Islamism at that time. He would start with lectures that "broke down the concepts they had been told they should hold dear – like freedom and democracy", he says. It was only in the second or third talk, once humanism lay in rhetorical rubble, that he would announce: "God is in a better position to set those limits than you are, because you'd always contradict yourself, being an imperfect human." So then he would announce: "Let me tell you what God says."

When Maajid enrolled, there were hardly any girls wearing headscarves; by the time he was thrown out a year later, most of them were. The stand-alones were jeered at and harassed.

Maajid was elected President of the college's student union and he was prickling with a Messianic sense of mission. He saw Newham College as a microcosm of the changes that were swelling in the world. "It literally felt revolutionary. We had taken over the campus, and that we were soon to take over the world ... We really believed the caliphate would be established any day soon." On the school's open day for prospective pupils and parents, they staged a massive prayer demonstration. Dozens of them stood in the main hall, yelling to Allah for vengeance. "We wanted to show the parents that if you're sending your kids here, these are the people in charge," he says.

I ask if anybody was arguing for a more liberal form of Islam. Maajid laughs. "Absolutely not. No way. In fact, the only people who were young that were articulating any form of Islam were the Islamists."

The only substantial push-back came from rival religious groups – especially students with a Nigerian Christian background, known universally as "the blacks". There was a racist hysteria that they were muggers and rapists and "somebody had to stand up to them", Maajid says. "Along came us, these crusading Islamists, who didn't give a shit. We'd stand in front of them and say – we don't fear death, we don't fear you, we only fear God." Allah was in their gang, and they were invincible. Young jihadis from outside the college started to hang around there, to defend the Muslims from "the Christian niggers". A tall, aggressive recruit from Brixton called Saeed Nur was appointed as their "bodyguard". He intimidated everyone into silence.

The news reports from the time confirm what happened next. One afternoon, a row broke over the use of the college pool table, as Maajid stood watching. A Nigerian student wanted to push the Muslims off it, and began making derogatory remarks about Islam. Somebody called Saeed to "sort him out". As soon as he arrived, the Nigerian student pulled out a knife – and Saeed produced a Samurai blade and thrust it straight into the boy's chest. As he fell, the other Muslim students set on him with hammers and knives and pool cues. They beat him to death.

How did he feel about the victim? Did he think about his family? He prods the questions away with a grunt. Maajid says he felt "indifferent" to the victim, but was pleased "the Muslims prevailed in the end". He adds: "We were heroes in HT ranks." And he is back to his story. He doesn't want to retrieve his emotions.

He was expelled, and spent the next few years ascending the ranks of HT, while pretending to study at various colleges. But he wanted to be at the heart of the jihad – and in 1999 he found a way. Abdel Kalim Zaloom, the global leader of HT, issued a command from his hidden base somewhere in the Middle East. Pakistan had just unveiled its nuclear weapons to the world. Zaloom wanted them to seize Pakistan, so when the caliphate came it would be nuclear-tipped. Maajid enrolled at Punjab University as a cover – and jetted off to the country his parents had left a lifetime ago.

In the sprawling slum-strewn chaos of Karachi, Maajid found "the first crack in my ideological armour ... I thought – oh, my God. I had idealised Muslim societies, but the people here know less about Islam than we do. And look at how disorganised it is."

He met with a slew of junior Pakistani army officers who had been training at Sandhurst, Britain's elite officer training academy. "They seemed like quite decent, amiable chaps, who believed in our ideology," he says. They had been recruited by other members to HT, "and I told them to rise up the ranks of the army, and when we had an opportunity, to mount a coup and declare the caliphate in Pakistan."

And then, in the strangely bland CEO-speak these ex-Islamists often lapse into, he adds enthusiastically: "It was a very exciting project. We thought it would happen in the medium-term."

Maajid won't be drawn – not now, and not in our later conversations – on the details of this coup plot. Perhaps this is because he is worried about compromising his ability to visit Pakistan. The Pakistani military spokesmen say it's a lie. The officers were, Maajid says, quietly arrested by Pervez Musharraf's government in 2003, and are currently in prison. Maajid decided to move on to Egypt, and arrived to study in Alexandria on 10 September 2001. When he saw the news from New York City, he felt – that word again – "indifferent". HT technically opposed the attacks, on the grounds they were carried out by private individuals rather than by the army of a renewed caliphate. But Maajid says "There was a huge wave of internal sympathy for [Bin Laden], because he's an ideological comrade, isn't he?"

He started to recruit other students, as he had done so many times before. But it was harder. "Everyone hated the [unelected] government [of Hosni Mubarak], and the US for backing it," he says. But there was an inhibiting sympathy for the victims of 9/11 – until the Bush administration began to respond with Guantanamo Bay and bombs. "That made it much easier. After that, I could persuade people a lot faster."

Then, at 3am one morning, a cadre of soldiers smashed into Maajid's bedroom bearing machine guns and grenades. He was taken, blindfolded and bound, to an underground bunker below the state security offices in Cairo. There were around 50 other men penned in. For three days, he kneeled, and heard the men around him being tortured with electric cattle prods.

"I thought, 'This is something I have been mentally preparing for, for a long time. I knew this day would come,'" he says. On the third day, the guards dragged him into an interrogation room with another British HT member. They punched him in the face and whacked him with batons. They produced the cattle prod. Maajid told them they wouldn't dare to torture a British citizen. "So they took the cattle prod and began electrocuting my friend in front of my eyes."

The British Embassy called looking for its citizens. The interrogation stopped suddenly, and transferred them to prison. Maajid felt no gratitude. "All I thought was – why did it take them three days to find us? They obviously didn't care about the rights of Muslims." He laughs now – a cold laugh, at his former self.

In Mazratora Prison, Maajid was held in solitary confinement for thee months. It was a bare cell with no bed, no light, and no toilet: just a concrete box. Then he was taken out suddenly and told his trial for "propagation by speech and writing for any banned organisation" was beginning in the Supreme State Emergency Court. But Maajid's Islamist convictions were about to be challenged from two unexpected directions – the men who murdered Egyptian President Anwar Sadat, and Amnesty International.

HT abandoned Maajid as a "fallen soldier" and barely spoke of him or his case. But when his family were finally allowed to see him, they told him he had a new defender. Although they abhorred his political views, Amnesty International said he had a right to free speech and to peacefully express his views, and publicised his case.

"I was just amazed," Maajid says. "We'd always seen Amnesty as the soft power tools of colonialism. So, when Amnesty, despite knowing that we hated them, adopted us, I felt – maybe these democratic values aren't always hypocritical. Maybe some people take them seriously ... it was the beginning of my serious doubts."

For the duration of the trial, he was placed in a cramped cell with 40 of Egypt's most famous political prisoners. There were row after row of beds with only a thin crack between them to inch through. Maajid was thrilled to discover two of the men who had conspired to murder Anwar Sadat – Omar Bayoumi and Dr Tauriq al Sawah – had recently been moved to this dank cell. "This is like meeting Che Guevara – these great forerunners and ideologues who I can now get the benefit of learning from," he says. But "they were very fatherly, and they had been spending all these years studying and learning. And they told me I had got my theology wrong".

After more than 20 years in prison, they had reconsidered their views. They told him he was false to believe there was one definitive, literal way to read the Koran. As they told it, in traditional Islam there were many differing interpretations of sharia, from conservative to liberal – yet there had been consensus around once principle: it was never to be enforced by a central authority. Sharia was a voluntary code, not a state law. "It was always left for people to decide for themselves which interpretation they wanted to follow," he says.

These one-time assassins taught Maajid that the idea of using state power to force your interpretation of sharia on everyone was a new and un-Islamic idea, smelted by the Wahabis only a century ago. They had made the mistake of muddling up the enduringly relevant decisions Mohamed made as a spiritual leader with those he made as a political ruler, which he intended to be specific to their time and place.

Maajid's ideology crumbled. "I realised that the idea of enforcing sharia is not consistent with Islam as it's been practised from the beginning. In other words, Islam has always been secular, and I had been totally ignorant of the fact." But he says he found this epiphany excruciating. "I knew if I followed these thoughts wherever they would lead," he says, "I would go from being HT's poster boy to being their fallen angel."

His trial was finally ending with the inevitable verdict: guilty. When he emerged from Mazratora Prison into the damp half-light of Britain, he was dazed. HT hailed him as a hero. "After four years of ignoring me, they wanted me to be their rock star ... I was asked if I wanted to be the leader." But in March 2007, he sent out a mass email saying he was resigning from HT, threw away his mobile, and went home to Southend.

He spent a long summer eating his mother's cooking, watching television, and seeing the school friends he had shunned more than a decade before. "It amazed me. These were ordinary British guys and they knew what I had become – that I had hated Britain. And yet when they saw me, they showed me such warmth," he says. "They remembered me as I was. They didn't care what I had done. They had time for me."

In September 2007, Maajid appeared on Newsnight – the BBC's flagship current affairs show – to announce that he recanted not just HT, but Islamism itself. "What I taught has not only damaged British society, it has damaged the world," he said.

With a small band of other ex-Islamists, Maajid decided to set up an organisation dedicated to promoting liberal Islam and rebutting Islamism. They named in the Quilliam Foundation after William Abdullah Quilliam, an English businessman who converted to Islam in the late 19th century and set up the first British mosque. They are taking the organisational skills and evangelical fervour of HT, and turning it against them. They are also taking nearly £1m from the British government – the only way, Maajid says, to do their work effectively.

The last time I speak to Maajid he is on the refugee-strewn North-West frontier of Pakistan, touring the country's universities. He is lecturing to huge audiences about his own experiences, and arguing against literalism in Islam. The massed ranks of the neo-Taliban are not far away. "People here and in Britain keep saying – we've been waiting for something like this for such a long time," he says over the telephone. "They're so happy people are starting to speak out. They're terrified to do it themselves, but this emboldens them."

A large audience of young Muslims is waiting for him. Maajid says assertively: "You know, back when I was an Islamist, I thought our ideology was like communism – and I still do. That makes me optimistic. Because what happened to communism? It was discredited as an idea. It lost. Who joins the Communist Party today?" I can hear the audience applaud him as he walks onto the stage, and with that, Maajid hangs up.

III. Lost in liberalism

As the summer arrives and London begins to swelter, I sit with most of the "out" ex-jihadis in a slew of Starbucks across the city. We sip iced lattes and discuss how, not long ago, they tried to destroy Western civilisation.

They have different backgrounds: one is a Yorkshire girl with Hindu parents, another is a Northern boy whose father was a Conservative ultra-Thatcherite. Yet they are startlingly similar: they have all retained the humourless intensity of their pasts. And when they describe their Islamist former selves, they are distant and cold, as if describing a rather unpleasant acquaintance they did not entirely understand.

They wreath their stories in clouds of pointless detail: they talk for hours about the intricacies of seventh-century Meccan society, or the fine distinctions in the hierarchy of HT, willing you to understand it. It's a way of avoiding answering the hardest question – why? But from their scattered stories, I can trace something that seems genuinely new: an ex-jihadi way of looking at the world, that carries lessons about how to stop Western Muslims sinking into jihadism.

As children and teenagers, the ex-jihadis felt Britain was a valueless vacuum, where they were floating free of any identity.

Ed Husain, a former leader of HT, says: "On a basic level, we didn't know who we were. People need a sense of feeling part of a group – but who was our group?" They were lost in liberalism, beached between two unreachable identities – their parents', and their country's. They knew nothing of Pakistan or Saudi Arabia or the other places they were constantly told to "go home" to by racists.

Yet they felt equally shut out of British or democratic identity. From the right, there was the brutal nativist cry of "Go back where you came from!" But from the left, there was its mirror-image: a gooey multicultural sense that immigrants didn't want liberal democratic values and should be exempted from them. Again and again, they described how at school they were treated as "the funny foreign child", and told to "explain their customs" to the class. It patronised them into alienation.

"Nobody ever said – you're equal to us, you're one of us, and we'll hold you to the same standards," says Husain. "Nobody had the courage to stand up for liberal democracy without qualms. When people like us at [Newham] College were holding events against women and against gay people, where were our college principals and teachers, challenging us?"

Without an identity, they created their own. It was fierce and pure and violent, and it admitted no doubt.

To my surprise, the ex-jihadis said their rage about Western foreign policy – which was real, and burning – emerged only after their identity crises, and as a result of it. They identified with the story of oppressed Muslims abroad because it seemed to mirror the oppressive disorientation they felt in their own minds. Usman Raja, a bluff, buff boxer who begged to become a suicide bomber in the mid-1990s, tells me: "Your inner life is chaotic and you feel under threat the whole time. And then you're told by Islamists that life for Muslims everywhere is chaotic and under threat. It becomes bigger than you. It's about the world – and that's an amazing relief. The answer isn't inside your confused self. It's out there in the world."

But once they had made that leap to identify with the Umma – the global Muslim community – they got angrier the more abusive our foreign policy came. Every one of them said the Bush administration's response to 9/11 – from Guantanamo to Iraq – made jihadism seem more like an accurate description of the world. Hadiya Masieh, a tiny female former HT organiser, tells me: "You'd see Bush on the television building torture camps and bombing Muslims and you think – anything is justified to stop this. What are we meant to do, just stand still and let him cut our throats?"

But the converse was – they stressed – also true. When they saw ordinary Westerners trying to uphold human rights, their jihadism began to stutter. Almost all of them said that they doubted their Islamism when they saw a million non-Muslims march in London to oppose the Iraq War: "How could we demonise people who obviously opposed aggression against Muslims?" asks Hadiya.

Britain's foreign policy also helped tug them towards Islamism in another way. Once these teenagers decided to go looking for a harder, tougher Islamist identity, they found a well-oiled state machine waiting to feed it. Usman Raja says: "Saudi literature is everywhere in Britain, and it's free. When I started exploring my Muslim identity, when I was looking for something more, all the books were Saudi. In the bookshops, in the libraries. All of them. Back when I was fighting, I could go and get a car, open the boot up, and get it filled up with free literature from the Saudis, saying exactly what I believed. Who can compete with that?"

He says the Saudi message is particularly comforting to disorientated young Muslims in the West. "It tells you – you're in this state of sin. But the sin doesn't belong to you, it's not your fault – it's Western society's fault. It isn't your fault that you're sinning, because the girl had the miniskirt on. It wasn't you. It's not your fault that you're drug dealing. The music, your peers, the people around you – it's their fault."

Just as their journeys into the jihad were strikingly similar, so were their journeys out. All of them said doubt began to seep in because they couldn't shake certain basic realities from their minds. The first and plainest was that ordinary Westerners were not the evil, Muslim-hating cardboard kaffir presented by the Wahabis. Usman, for one, finally stopped wanting to be a suicide bomber because of the kindness of an old white man.

Usman's mother had moved in next door to an elderly man called Tony, who was known in the neighbourhood as a spiteful, nasty grump. One day, Usman was teaching his little brother to box in the garden when he noticed the old man watching him from across the fence. "I used to box when I was in the Navy," he said. He started to give them tips and before long, he was building a boxing ring in their shed.

Tony died not long before 9/11, and Usman was sent to help clear out his belongings. In Tony's closet, he found a present wrapped and ready for his little brother's birthday: a pair of boxing gloves. "And I thought – that is humanity right there. That's an aspect of the divine that's in every human being. How can I want to kill people like him? How can I call him kaffir?"

Many of the ex-Islamists discovered they couldn't ignore the fact that whenever Islamists won a military victory, they didn't build a paradise, but hell.

At the same time, they began to balk at the mechanistic nature of Wahabism. Usman says he had become a "papier-mâché Muslim", defining his faith entirely by his actions, while being empty inside. "Wahabis are great at painting themselves [an Islamic] green on the outside, but when it comes to that internal aspect, it's not there. You pray five times a day, but why? Because God's told you to pray five times a day. You pay your charity – why? Because God's told you to pay your charity. This God of yours is telling you a lot. And why does he tell you to do that? Because if you don't do it, you'll end up in a fire. It's all based on being frightened. There's nothing to nourish you."

They had to go looking for other Islams – and often they found it in the more mystical school of the Sufis. "Wahabi Islam is totally sensory: eye for an eye, tooth for a tooth," Usman says. "It lays out a strict set of rules to be followed here on earth, every moment of the day. Sufi Islam teaches instead that the realm of Allah is wholly separate and spiritual and nothing to do with the shadow-play of mere mortals. It is accessible only through a sense of mystery and transcendence." In this new Sufi Islam, Usman found something he had never known before: a sense of calm.

Ed Husain insists: "There are a lot of Muslims who agree with us. A lot. But they're frightened. They see what's happened to us – the hassle, the slander, the death threats – and they think: it's not worth it. But you know what? When I first spoke out, I was alone. I had no idea that, a year on, there would be this number of people speaking out, and many more who are just offering resources and support. Once a truth is spoken, it takes on its own life."

IV. Not Strawberry Season

Anjem Choudhary waves his hand angrily through the air, and says that in the world he wants to create, the people I have been interviewing will be put to death. "They are apostates. I don't consider [them] to be Muslim in any sense of the word," he says. "Everybody knows the punishment for apostasy." My facial muscles must involuntarily react, because he leans forward and asks suspiciously: "Are you Jewish?"

Anjem is one of the last of the famous Islamists from the 1990s still walking London's streets, free and furious. A decade ago, this city hosted a stream of fanatical Muslims who kept cropping up in the tabloid press as semi-comic pantomime villains. But gradually, one by one, they have been deported or arrested, leaving Anjem as their final public face. He has said the Pope and the Mohamed cartoonists should be executed, and has lauded the 7/7 bombers as "the Fantastic Four".

I wanted to see what the people the ex-jihadis have left behind make of them – and to sense if they are seen as a real threat. Anjem suggests meeting me in the Desert Rose Café in Leyton, not far from Usama's mosque. The 41-year-old lives here on social security benefits, paid for by a populace he believes should – in large measure – be lashed, stoned or burned in the hellfires. A long beard covers his chubby face, and long white robes cover his swollen form. I was surprised he agreed to meet me. He rarely speaks to print journalists. The last time he did, he stormed out, accusing the reporter of being a paedophile.

He immediately launches into a lecture about how the ex-Islamists are all liars and charlatans. They are "government bandits, set up by them and funded by them to do their dirty work within the [Muslim] community ... They were never actually practising! They were ignorant of Islam."

When I read him statements by ex-Islamists, he spits: "This is heresy ... The Muslim must submit to the sharia in all of his life. If I start to say things like, 'I don't believe the sharia needs to be implemented,' then that's tantamount to denying the message of Mohamed ... To say that any part of the Koran is not relevant nowadays is a clear statement of apostasy."

Taking any part of the Koran as metaphor will, he warns, cause the text to turn to dust in their hands. "I can't pick and choose what I like from the scripture. This is not strawberry season, where you can pick your own strawberries. You abide by whatever Allah brought in the final revelation with the example of the Prophet. And if there's something that you don't like, then you need to correct your own emotions and desires to make sure they're in line with the sharia."

He describes what is going to happen to them with a grin: "After they've been burnt, their skin will be recreated, and they will suffer the same punishment again and again and again."

I wondered if Anjem's biography fitted with that of the ex-jihadis' – or was there something different about them all along? Anjem says he was born in Welling in South-East London in 1967, where his father was a Pakistani immigrant who ran a market stall. He first realised the One and Eternal Truth when, one day in the early 1990s, he happened to hear a lecture at a local mosque by the Syrian-born Islamist Omar Bakri. Until then, Anjem had been living a life of sin as a young trainee lawyer, known to his friends as Andy. The British tabloids have exposed that he had sex with white women and dropped LSD.

But as he tells it, in the flames of Bakri's rhetoric, Andy was burned away, and Anjem was born. "Yeah, obviously, I had a period where I was not practising ... I have no shame at all in saying that I didn't always use to be like this. And I have great thanks to Allah that he guided me."

Yes, I say – but you would whip and lash and execute the person you were 20 years ago. His eyes flare. He pushes back his chair, half-rising to leave. "What I used to be like and what I used to say before isn't under discussion. If you're going to continue to ask about that, then I'll just stop the interview."

He then launches into half an hour of theological gobbledegook, where any question I try to interject is waved aside with a sneer. He has no interest in persuasion: with dull Torquemada eyes, he advocates the execution of anyone who disagrees. Is he scared of the ex-jihadis and their arguments? He is certainly angry with them – but he is so angry at everyone that it is hard to tell what this means.

He begins to ask – jabbing his finger – what my alternative is. "In the United States, bestiality is legal in the privacy of your own home," he says. Paedophiles are rampant, with the Man-Boy Love Association on the brink of success. Compare that with the 1,300-year long caliphate. In all those years, he says, "there were only 60 rapes".

Do you really believe that if people are not suppressed by a tyrant-God, they will become paedophiles and start fucking animals? Are you so rotten inside? Does Anjum fear Andy that much?

He stares at me, flat and emotionless now. "That is your last question," he says. And as I leave and look back at him through the glass, jabbering on his phone and daydreaming of annihilation, I realise how far all my interviewees – and new friends – have travelled.

They have burned in this fire of certainty. They have felt it consume all doubt and incinerate all self-analysis. And they dared, at last, to let it go. Are they freakish exceptions – or the beginning of a great unclenching of the jihadi fist?

To watch Johann Hari taking on Hizb ut Tahrir in a debate on the Islam Channel, click here

You can follow Johann on Twitter at www.twitter.com/johannhari101