I moved out of home when I was 18. My first place was an apartment and I became friendly with the guy who lived above me. I was having a beer with him one night and asked him if he was gay. I told him I had always wondered whether I was.

I had sex with him that night. He was much older than me, and I wasn’t attracted to him, but I wanted to experience what it was like to be with a man. Afterwards, I felt awful about what had happened. When I was growing up, the word “gay” was a slur; I’d only ever heard negative things about homosexual life. My parents would call and I’d start crying, but I could never tell them why.

Slowly, I started to come to terms with my gay identity. The first time I went to a gay club, it was like I’d found a new home. In my early 20s, I lived for three years as an openly gay man. I had a partner and we were about to move in together. Then one day, in bed, he started crying. He told me he had been out drinking one night and killed someone while driving. He had managed to keep it from me, but had just been sentenced to eight years for manslaughter. I was in love with him, but he was taken out of my life.

The idea of being alone scared me. Most of the relationships I’d had with men had been just about sex. There was a part of me that wanted to have a wife and children, and a happy home with a white picket fence. When a friend and his wife reached out and asked me to go to church, I decided to give it a go. After a few months, I felt as if I’d found something of meaning: I believed that God loved me and had a plan for me – and that plan did not include homosexuality.

One day, I was in the car and heard a radio ad for a Christian conference. It said: “If you’re gay or lesbian and don’t want to be, make a change.” I went to the conference and met a counsellor from a support group for men who were “coming out of homosexuality”. We discussed how I could be more masculine and date women again. I saw him, on and off, over the next eight years.

I met my wife at church. We had a lot of the same interests and I liked her a lot. I told her I used to be gay – which was how I thought of myself at the time. We dated for about six months before I asked her to marry me.

I began working with my counsellor to help other gay Christians. Eventually, I decided to start my own ex-gay ministry. By that point, I was a zealot: I didn’t have any doubt and felt as if I was on a mission from God. I counselled hundreds of clients over 28 years. But while I was telling others to repress their sexuality, I was still struggling with my own. I was honest with my clients about my sexual thoughts and struggles with gay pornography. I told them those feelings never go away – it was about learning to deny same-sex attractions.

That honesty came back to bite me. One day the board chairman of the ministry walked into my office and said he had discovered I was still watching gay porn. He fired me. I was crying, but that night my wife said: “You don’t realise this now, but this is a blessing.” She could see that ministry life was eating me alive.

That was the start of a journey. I realised I had been used as a tool by the church. It wanted to say, “Look, this guy changed, you can, too.” But I had not changed. About 18 months after I was fired, I posted on Facebook: “I have no room for hate in my heart. I know I’m not anti-gay. I am gay.” I received hundreds of messages. The majority of people were appreciative, but some were very angry. Whether it was a well-wisher or a death threat, I responded to every message. I asked people to give me a chance.

My faith in God is just as strong, if not stronger, than it has ever been. I never believed that God was as harsh as everyone was telling me he was. I want to help the church to love and accept people, regardless of their sexuality, and to play a large part in ending conversion therapy.

Hopefully, I can find some personal happiness in relationships. I feel as if I escaped a cult: I was brainwashed for 28 years. I’m now able to start exploring who I authentically am.

• As told to Mark Wilding

Do you have an experience to share? Email experience@theguardian.com