A group of ultra-Orthodox Christians attacked the protesters, who were waving rainbow flags and some carrying signs reading "Russia is not Iran", and preparing to stage the unauthorised demonstration.
Police moved in and wrestled both activists and members of the religious group to the ground before leading them off in handcuffs to waiting security vans.
Those detained included French gay rights activist Louis-Georges Tin and the US’s Dan Choi and Andy Thayer.
British gay rights campaigner Peter Tatchell said that the police tried to lead him away as well but that he had managed to break free.
A Moscow police representative told Moscow Echo radio that 34 activists had been
detained within the first minutes of the rally.
Moscow has banned gay pride parades for six years running. Former mayor Yury Luzhkov once likened gays to the devil.
The European Court of Human Rights in October ordered Russia to pay one
local rights leader damages for banning earlier marches.
Tatchell claimed to have seen three police buses “packed with people who looked like skinheads and neo-Nazis” parked outside the Moscow mayor's office.
"Our suspicion is that they were police officers in civilian clothes. We suspect that a sizeable portion of the neo-Nazis were actually undercover police officers," he said.