Ten years ago, I was sent from Britain by a global Islamist group to recruit in Pakistan. Stepping off the plane in Lahore, I slowly breathed in the scene around me. With minarets and azans almost like background props and mood music, the Muslims I saw in every direction whetted my appetite for revolution. We were going to radicalise the country and foment a military coup against the democratically elected "client" ruler, Nawaz Sharif. I was 21 years old. I was part of a vanguard to set up a Pakistani branch of Hizb ut Tahrir (HT), so that their future caliphate could go nuclear. Nothing was going to get in my way. Nothing did.

Ten years on (during which I spent five years as a prisoner of conscience in Egypt), I recently returned. I had left HT and recanted Islamism. I was back, determined to reverse some of the Islamist fever I had helped instil. Whereas in 1999 Pakistanis thought my wife and I were Arabs due to her "Egyptian" headscarf, now rumours were rife about acid attacks on women walking the streets uncovered. I was older, wiser and smarter. This time, the revolution would be against Islamist hegemony.

I was on a four-week, nationwide university tour to speak against Islamism and to urge students towards pluralistic, democratic values. Contrary to western mythology, Islamist radicals are found among the educated, the elite and the socially mobile. Yes, a minority of Pakistani madrasas provide an ample supply of jihadists, but the ideologues are smart and modern.

Bin Laden, Zawahiri or, indeed, the many pseudo-intellectuals of HT are highly educated and socially mobile. Many madrasas are simply antiquated religious schools belonging to the conservative but apolitical Barelvis, Pakistan's majority religious denomination. Jihadists despise this faction. Nine days ago, a jihadist blew himself up in a Pakistani mosque, murdering the leader of the Barelvis, Dr Sarfraz Naeemi. The poor are simply used as jihadist cannon fodder.

Thus it was that we began in Karachi and worked our way around the country. We ventured deep into the deserts of interior Sindh and then across into the turbulent outback of Quetta, Balochistan, where the Taliban and al-Qaida fighters are said to be headquartered. From there, we crossed into the Punjab, ascended into Kashmir and then finally up to Islamabad. In our flak jackets, with a security detail in tow, we addressed thousands of students.

In Quetta, armed separatist students threatened to shoot anyone coming to the talk. Their gripe was with the Pakistani government from which they wanted independence. Like so many things in Pakistan, our role in this was eventually settled over a cup of "chai".

My first real taste of the diversity that is Pakistan came here. I met popular revolutionaries who despised Islamists, yet wanted to secede, in some cases by violence, from Pakistan and "Punjabi hegemony". They began their speeches in the name of Allah, but ended with: "Death to Pakistan." They blamed the "Punjabi" government squarely for the ills of jihadism. Destroying Pakistan was not exactly on my agenda.

Pakistan and its problems are not monolithic and are not all related to Islamism. Corruption, ethnic and economic factors and a lack of leadership all play out differently in each province. I found the people of Sindh to be hugely sympathetic to our message. Conversely, the people of Mirpur, in "free" Kashmir, from where more than 90% of British Pakistanis come, and where sterling is a currency of choice, were hostile to the west. It was in Punjab where I found most of the denial culture. The west was to blame for everything, including sending me as an agent to set up HT in Pakistan and then as an agent trying to push back HT. You see, the trouble with conspiracy theories is that they were invented by the infidel west to stop Muslims thinking.

In Lahore, I was attacked by a British member of HT. He, like many others, had left the UK to recruit vulnerable Pakistani students. He was also a teacher at a private university. After this attack, we started receiving death threats. Our security advised us to cancel the rest of the tour. We chose to carry on.

It is true that Pakistan has exported its fair share of Jamaat-e-Islami Islamists and pro-Taliban jihadists to British shores. Many Pakistanis are in denial about the role their country has played in the growth of Islamism and jihadism. When we pushed them, however, most acknowledged the rise of the "religious right". Denial is never a good thing when trying to solve a problem.

Here in the UK, after the release without charge of the 12 Pakistani student terrorism suspects, we could do with a dose of truth serum too. During the rise of British Islamism in the 1990s, HT was exported to Pakistan from Britain by the likes of me. In London, in 2000, I met Sandhurst-trained Pakistani officers who had been recruited from here and were being sent back to Pakistan to instigate a military coup.

The man who physically attacked me was a British citizen who joined HT in the UK. British members of HT also played crucial roles in exporting their group to Indonesia, Malaysia, Kenya, Mauritius, India, Egypt and Denmark, among others. I know because in each case I know the people who did it. Only when the people and governments of Britain and Pakistan take responsibility for the rot on their doorsteps can we start moving seriously towards solutions for the problem of extremism.

Our tour was partly to initiate such a thought process. By showing people that one does not have to be against Islam to be against Islamism, we hope to resolve the moral dilemma that many face.

Military means can only ever be a stop-gap. As the near Taliban takeover in the northern regions of Pakistan showed, if civil society cannot segregate the masses from Islamists, then American drone attacks will be the least of our worries.

• Maajid Nawaz is the director of the Quilliam Foundation. A film of his trip will be shown on BBC's Newsnight on Tuesday

• Nick Cohen is away