I grew up in an Islamist household. My parents followed the version of Islam known as 'Salafism', or 'Wahhabism'. Salafism is a largely Saudi-inspired form of Islam, one that provides a more literalist interpretation of Islamic texts, and deems Islam as a religion to be something that is unchanging and inflexible in nature. In essence, what it teaches is that whatever happened 1400 years ago during the inception of Islam – in terms of norms and practices then – should be replicated in the 21st century. For example, this is how Isis, an expressly Salafist group, has justified resurrecting the practice of slavery.

As a young Salafi, inculcated with the Islamist ideology since childhood, I was brought up believing that there is a neverending war between Muslims and the infidels, or the 'kuffaar'. I was taught that my country of birth, the United Kingdom, was the enemy, that I was living in enemy territory and that it was the duty of every Muslim everywhere to fight a violent form of 'jihad', a religious war, against the infidels.

When Nato forces invaded Afghanistan, and when later Britain and the US invaded Iraq, I was told that this was all part of the war against Islam. I was told as much by British Imams in London. Not some city in Saudi Arabia, but here in London. These were largely foreign, Saudi-trained Imams. The preachers and Imams in mosque didn't clearly point out what they meant by this war - but followers were aware of what was being alluded to.

On top of this I was fed a daily cocktail of conspiracy theories about how 9/11 was carried out by the US in order to provide pretext to invade Muslim countries for the sole reason of subjugating Muslims. I was also told that democracy in the West is a sham, that the inner workings in parliament were only put on for show, that everything had been decided already by the shadowy people 'at the top'. Unfortunately, whilst this may sound silly to the educated individual, such conspiracy theories are commonly believed in the Muslim world today.

When I was in college, my anger and hatred towards the West boiled over to the point that I began to consider carrying out terror attacks in my home city, London

Growing up in school was confusing because I had non-Muslims friends whom I wasn't supposed to like and was taught not to engage with – but I did like them. As my mother was in a full face veil, the niqab, and my father had a long beard, the teachers were aware that I was from a very extremist Islamic household, and because of that I did face discrimination. It was an isolating experience.

I was also taught that gay people should be executed, while at the same time I was beginning to realise that I myself was attracted to the same gender. It got to a point where I would try everything in my power to become straight; to get rid of those feelings. One of the things the scholars would say is that in order to cure sexuality, you need to become more religious, and become more devoted. So while the Iraq/Afghanastan war was happening, I also had the internal issue of my sexuality; becoming more religious was an attempt to atone for my sins. In an attempt to cure myself of my sexuality I became even more extreme.

When I was in college, around the age of a mere sixteen years old, my anger and hatred towards the West and my own country of birth boiled over to the point that I began to consider carrying out terror attacks in my home city, London. And I almost did so. This is distressing for me to talk about, but thankfully, I brought myself back from the edge of carrying out actual violence.

Unfortunately, Khalid Masood, the perpetrator of the Westminster Bridge atrocity and a convert to Islam, did not.

Khalid Masood, 52, a British born convert to Islam, is known to have had a troubled past. He had previous convictions for violent crime, and had spent time in three prisons. It is thought he may have been radicalised in prison. Converts to Islam are disproportionately more likely to be involved in extremism and to partake in acts of terror as compared to those Muslims who are born into the religion.

This could be for a number of reasons. First, I think those most adamant on proselytisation are the extremists. Second, converts, having found their new faith, will find a passion and zeal unlikely to be matched by the most ardent zealot. Suddenly, a convert finds meaning in life, and this gives them a sort of spiritual high, which is then concentrated toward extremist ends. Third, converts may feel the need to prove their devotion and faith to those born into the religion, and thus will go to extreme ends to prove as much, which will in some cases result in violence in the name of their religion.

Islam is currently undergoing a rapid pace of change. The Islamist strand of Islam is growing at an exceptionally high rate. This is largely a result of the Saudi-led proselytisation movement, fueled by petrodollars. The United Kingdom is currently awash with Saudi-trained Imams and preachers. What is compounding this problem is the fact that the internet is full of Islamist propaganda. This is what directly led to my own radicalisation.

The ideology that gives rise to this form of bloody terror, the ideology of Islamism, is far more widespread than our government or the media would like to admit

Not only that, but given that access to the Qur'an and the Hadith, (the recordings of the sayings and doings of the prophet), is made a lot easier by the internet where ideas have no borders; individuals can search for particular verses or hadiths and form their own interpretation, a literalist and puritanical interpretation. Without a formal education in Islamic studies, young Muslims or new converts, like Masood, can easily buy into simple, literalist readings of Islam. For me, it felt empowering to be able to be able to access, read, interpret and understand the religious texts for myself. Ironically, it was this democratisation of religious knowledge that fed into my own radicalised mindset.

It is also important to note here that acts of Islamist terror are usually caused by a sense of religious devotion and fervour. Justification for acts of terror are sourced from literalist and de-contextualised interpretations of the religious texts. Whilst there is no single terrorist profile or personality, terrorists tend to be united in a misguided sense of morality. They do not view themselves as extremists.

Rather, they view the majority of us who are liberal and secular to be extremists. They consider themselves to be defenders of their faith, against a virulently secular order that is infringing upon their ideology and view of the world. This is what I myself believed, when I was at my most extreme. I saw myself as a soldier of God, defending His religion. It gave me a sense of a purpose, a sense of belonging, a sense of being part of something bigger than myself.

Another factor that can lead to individuals carrying out acts of Islamist terror is the guilt of sin. I myself carried around my own sin: that of my sexuality. I was ashamed of my thoughts and my acts with other men whom I sought out for sexual endeavours as a young teenager. It's conceivable that converts could feel guilt for a previous sinful life as a non-Muslim, or as an infidel. This could even lead them down the extremist path as a method of self-atonement - just as I had done a few years ago.

In an attempt to cure myself of my sexuality I became even more extreme

I left that path, thankfully, through deep introspection and study of the Islamic texts. What triggered this process was my realisation of the apparent contradictions between my religious beliefs and scientific facts such as human evolution. This involved studying them in their sociohistorical contexts and differentiating the guiding and objective principles of Islam from the detailed minutiae. I also consulted the works of progressive Islamic scholar Usama Hasan who used to be an Imam at my mosque. He changed before I did and I followed in his footsteps - he went on to work at the Quilliam Foundation (the counter extremism think tank).

To young gay Muslims struggling themselves, I would advise looking at interpretations of Islam that are accepting of LGBT Muslims and liberal interpretations of the Qur'an. It might sound ridiculous, it might sound like it's a Western attempt to neuter Islam, but in my opinion those interpretations are watertight and convincing. I would also recommend that young Muslims being taught these extremist lessons should look at groups like Muslims for Progressive Values, so they can consider both sides of the argument.

Unlike me, Masood and others failed to leave the extremist path. What we all need to realise is that the ideology that gives rise to this form of bloody terror, the ideology of Islamism, is far more widespread than our government or even much of media would like to admit. The problem is currently growing and spreading like a metastatic cancer which is sweeping up many of my fellow Muslims in its wake.

There is a serious issue with integration and ghettoes forming in certain areas of the UK, especially with Muslim ghettoes, as there can be extremism festering and people don't communicate with others outside their community. That group mentality can be extremely dangerous. We also have to be careful with the Imams and preachers we let into the UK. The message these Imams preach to non-Muslims seems fine - but Islamists are aware of the wider context. So to one audience there is one message, and to the other audience, the inner audience, another message is being conveyed. We need to work with individuals who are former Islamists to see who is spreading these toxic ideologies.

The only way to combat this problem from the source will be to tackle the ideology of Islamism by way of theological and philosophical debate. The forms of Islam that convinced me to turn my back on Islamism and Salafism need to be promoted much more widely. In doing this, we can tackle the global development of Islamism.

Sohail Ahmed is an activist and commentator focusing on LGBT rights and Islamism.