I first met Nicolai Alexeyev in 2000 at the British Library exhibition on my grandfather Oscar Wilde I had been co-curating. In the intervening years we have become close friends. Nicolai is a young, very sharp, Russian lawyer - and he's gay. On Saturday 27 May, in the early afternoon, he was arrested for trying to put a bunch of flowers on the tomb of the unknown soldier in the Alexandrovski Garden of Moscow's Kremlin. Nicolai has actively been challenging the homophobic behaviour of Russian institutions and the media for the last four years, relying on Russian anti-discrimination laws to back him. More than a year ago he floated the idea of a first Gay Pride march in Moscow. Some gay groups were apprehensive, saying that it was too early, especially as the growing neo-fascist movement in Russia had threatened violent opposition to gays in public. Undeterred, Nicolai pressed on, asking me if I would take part and also if he could publish two books on Wilde in Russian translation – The Trial of Oscar Wilde and Son of Oscar Wilde (my father's autobiography) - to coincide with the event.

I was hesitant. I'm not a gay man and gay activism isn't really my scene, but I agreed to go when I heard that the first IDAHO (International Day Against Homophobia) conference was to be part of the programme. It was, after all, Victorian homophobia that brought my grandfather to prison and bankruptcy and had made such a misery of the first 30 years of my father's life. Publication of the two books was a perfect adjunct to the conference and the conference was the right moment for me to raise my voice against homophobia.

I arrived in Moscow on the Wednesday before the march. The mood was positive but uneasy: two gay clubs had been targeted earlier in the month by an alliance of neo-Nazi skinheads and Russian Orthodox Christians. Moscow's mayor, Yuri Luzhkov, had officially banned the march six days before. Nicolai had appealed against the decision in the courts and applied for permits for static demonstrations against the suppression of human rights in front of the City Hall, in Lubyanka Square and in Pushkinskaya Square. These too had been refused. The appeal would not be heard for months. All of these decisions were in direct contravention of Article 11 of the European Convention on Human Rights, which Russia had signed as a member of the Council of Europe.

On Thursday came the news that the court had convened a special sitting to consider the appeal the following morning. Some thought that this augured well; others assumed it would merely serve to emphasise the ban. Whatever the outcome, the authorities were clearly taking it very seriously. In the afternoon Nicolai was summoned by the Deputy Chief of Police to explain why he was quoted on the news website Interfax as having said that the march would go ahead regardless. He hadn't. Distortion, half truth and mischief-making were all part of the fevered climate surrounding the proposed march. That evening I gave a lecture on Oscar Wilde at the State Library for Foreign Literature. The Director, Ekaterina Genieva, had hosted controversial events before in the spirit of tolerance and diversity she said the Library represented. Police were stationed at the entrance, but that didn't prevent 20 neo-fascists from slipping into the audience with a canister of choking-gas and disrupting the lecture 10 minutes after the start. The audience recovered its breath, no one left and I completed the lecture in another room. This attack was a mere appetiser for what was to come.

Friday morning the IDAHO conference started in the Swissôtel. By midday, we learned of the court's decision to uphold the Mayor's ban. The afternoon sessions were cancelled and the time given over to deciding on what course of action to adopt on Saturday, the day of the banned march. To do nothing would be to give in to neo-fascist threats and the blatantly illegal city council decisions, and might be seen as a defeat. To march without proper police protection would be suicidal, apart from being illegal. We eventually decided to make our separate ways to the tomb of the unknown soldier and lay flowers on it. The gesture would be significant as the tomb is also a monument to the defeat of fascism in World War II. From there we would walk in a group up Tverskaya Street to demonstrate briefly in front of the City Hall, display rainbow flags and unfurl the Moscow Pride banner.

At the midday press conference on Saturday the delegates barely outnumbered the media. We had rapidly put together a 'Moscow Human Rights Appeal' which was signed by all the delegates, among them Sophie in't Veld, the Dutch MEP, Volker Beck, the German Green MP, Clementine Autain, Deputy Mayor of Paris, Scott Long from Human Rights Watch and Edward Murzin, a Russian Liberal deputy from Bashkortostan and the only Russain politician brave enough to associate himself with the events. Two-thirty at the tomb and no later than three o'clock at the City Hall. A German television crew gave Nicolai, Peter Tatchell and me a lift to the Kremlin. We bought flowers on the way. As we passed the completely police-cordoned Lubyanka Square, circling the Kremlin for the fourth time, it started to rain heavily. "Only Luzhkov and Putin together could achieve this," said Nicolai.

His phone rang. "They've shut off the entrance to the tomb." It was two thirty. We got out of the minibus into the rain and started walking, flowers in hand. If we had had rainbow hair, it couldn't have been more obvious who we were. Ed Murzin joined us. By the time we were within 10 feet of the police cordon we were surrounded. I think it was the circle of photographers that saved us from being trampled by the neo-Nazis, who chanted homophobic slogans. Ed and I tried to link arms with Nicolai, but were slowly edged apart from him by the crowd, which seemed intent on crushing us. Police forced their way through from behind, relieving the pressure, but the three of us by now were totally separated. They dragged Nicolai off to a police bus, as much for his own protection as anything. He was an unmistakable figure after so much media exposure. What I didn't realise was that I probably was too after the publicity posters for the lecture and an article and photo in Moscow's highest circulation newspaper.

The fascists flowed away in front of the advancing riot police line and I followed, taking photographs – madness with hindsight, but acting like a tourist may have saved me from a beating. They regrouped and started moving towards Tverskaya. I was recognised by a woman who had been among the disrupters at the lecture. She threw a couple of eggs and started shouting and pointing at me. This time I was saved when the neo-Nazis set off flares to delay the police advance. In the diversion, I found Professor of Human Rights Law Robert Wintemute, another conference delegate, who offered me shelter under his rainbow umbrella. Strangely oblivious to the fact that this object would attract the attention of the mob, we set off up Tverskaya towards the City Hall. I heard shouts from behind and the approach of running feet, followed by a tremendous kick in the back. I staggered but didn't fall. If I had, those who came behind would certainly have made their own contributions. They passed through.

We felt sheepish and defeated as we shut up our rainbow brolly, but, outnumbered by about ten to one and faced with raw hatred from a mob baying for blood, anything else would have been foolhardy. A few supporters, principally those who hadn't come to the tomb, had already grouped opposite City Hall. Some sported rainbow flags; the banner had gone with Nicolai. Despite the riot police, there were injuries, Volker Beck among them. The job of the police was to keep the two sides apart, not to afford protection for us, as I discovered a few moments later, when Robert and I found ourselves on the wrong side of a police line faced by a dozen thugs. The pack leader thrust his face into Robert's, held him against a car and shouted "Ubiraites iz Rossii, ebanye pidory" ("Get out of Russia you faggot"). I had similar abuse hurled at me from further away, was hit by another egg and potatoes – they could easily have been bricks or bottles. The police, three feet away, just looked on. Rentacrowd toothless old babushkas followed behind (someone said they were paid a few hundred roubles each to turn out) and sprayed us with 'holy water' from plastic bottles, shouting "Moskva ne Sodom" ("Moscow isn't Sodom"). Finally we retired to the safety of a café for two hours until the streets cleared.

There were no really serious injuries so far as I know, and anyone who was hurt can console themselves with the fact that it was a small price to pay for publicising the cause of gay people like Nicolai Alexeyev in Russia. Every kick, every punch, every insult of that day has been reversed, turned back on the homophobes, done them more disservice than they could ever have imagined. In some ways the outcome has been far more effective than if the march had been allowed and no one had taken much notice.