Being gay in Uganda has never made for an easy life. I’ve long refused to hide my sexuality or to be ashamed of who I am. And I’ve had to accept that a certain amount of risk comes with speaking out, as I do regularly, about the injustices and abuse suffered by lesbian, gay, bisexual, transgender and intersex (LGBTI) people in my country.

That being said, I was starting to feel as though there were reasons to be positive and to hope for change. The abominable Anti-Homosexuality Act, about which I wrote for the Guardian in 2014, was later rescinded. Our close community of activists committed to improving the lives of LGBTI Ugandans is vibrant and as strong a movement as it has ever been. Some of us have even received global recognition for our work. And so Uganda Pride 2016 was set to be a long overdue celebration of our hard work and resilience.

It was during these celebrations last week that my illusions of safety and hope were cruelly shattered.

Last Thursday, three days into Uganda Pride week, I was excited to attend the Mr and Miss Pride beauty pageant event at a nightclub in a Kampala suburb. The night ended in atrocities: violence, torture, arrest and the imprisonment of LGBTI people, including myself.

I was seated in the audience when Ugandan police armed to the teeth walked into the venue. They wanted to immediately stop the proceedings. As I started talking to them, they arrested me and my colleague, one of the Pride organisers. My hands were cuffed together with another friend who had organised the event that night. Sixteen of us were arrested for sitting enjoying ourselves, committing no known crime. I was then pushed under the seats of a police pick-up truck and, amid insults and abuse, driven at a high speed to the police station where I was detained for about two hours.

Other friends describe that some participants were being held at gunpoint at the club, as police forced them to sit on the ground and have their photos taken by journalists. Before I was taken from the club I saw police beating up transgender people, a trans woman was forcefully being dragged down the stairs by a man not in police uniform. Trans men and women were touched inappropriately as officers of the Ugandan police force tried to establish their “real gender”. They also pulled on a trans women’s hair saying: “What is this? This is women’s hair; you are a man.” I was told some police officers holding two men at gunpoint claimed that they were caught having sex. It is beyond me who would have the guts to have sex in that kind of situation.

We were arrested for enjoying ourselves, committing no known crime. I was then pushed under the seats of a police truck

At the police station, no one took our statements and we were literally thrown into police cells, where we were held for more than an hour. At some point during the night, inmates ordered us to bathe using a dirty water basin and a small piece of soap in a room lit only by a candle. I had to hand my clothes to another inmate who watched to make sure I bathed and there was only small a piece of cloth hanging by the bathroom door for privacy, what looked like an old torn curtain. The intention was clearly to humiliate and intimidate us. Some of my friends were beaten up for “not bathing properly”.

We were then called out of the police cell and paraded into a line and told that we would have to be physically checked to ascertain our gender. They had just picked out myself and five others when someone who was not in police uniform appeared and asked for us to all be released. I later learned that he was the police chief for the particular region.

There has been no apology. I still do not know under what law I was arrested and detained. None of us was committing a crime. While gay sex is illegal in Uganda, going to a nightclub with friends for a party is not. Neither do you have to obtain a licence from the police to do so, despite the inaccurate and offensive rant that Uganda’s ethics and integrity minister, Simon Lokodo, posted over the weekend.

In it he says, “Government will not condone the promotion of the illegal activities of the LGBT movement.” And adds: “We wish to emphasise that whereas the promotion of homosexuality is criminalised under the penal code, there is no violence against the LGBTI community in Uganda – contrary to some claims made loosely by proponents of this movement.”

If I wasn’t so deeply offended, I would laugh.

Lokodo may deny “allegations” that people were injured during the police raid, but what does he say to the man who jumped from the fourth floor of the building to escape police brutality? He ended up breaking two vertebrae. He is now under medication and requires at least $5,000 (£3,830) for treatment. There were all sorts of incidences of harassment and indecent treatment that caused both physical and emotional injuries to everyone at the party that night.

And oppression of LGBTI people is not just taking place in Uganda. We are also dismayed by what is happening in other African countries including Tanzania. We have heard that the government there has banned importation of lubricants, aimed at sending a message to the LGBTI community, and has even announced plans to suspend the registration of any charity or NGO that supports homosexuality.

To us, Lokodo says: “A programme to rehabilitate members of the LGBTI community, with the ultimate aim of giving them a chance to lead normal lives again has been developed.”

I say, no thank you. The problem is not who I am. The problem is how you treat me.