MOSCOW – A judge here ruled on Friday that the former chess champion Garry Kasparov was not guilty of participating in an unsanctioned political demonstration outside the courthouse where three women in the punk band Pussy Riot were convicted of hooliganism last week and sentenced to two years in prison.

Mr. Kasparov, who has long been active in opposition politics, was arrested while giving interviews to journalists. He was in a crowd that gathered outside the courthouse in anticipation of the guilty verdict against the three women who had staged an anti-Putin stunt inside the Cathedral of Christ the Savior in February.

The acquittal was a rare victory for a member of Russia’s political opposition. Rarer still were remarks by the judge, Ekaterina Veklich, who said that she did not believe some of the police testimony in the case. “The facts recorded in the police report,” she said bluntly, “do not correspond to reality.”

In an interview in the courtroom after the decision, Mr. Kasparov, 49, seemed stunned and exhilarated. “It’s like Christmas,” he said.

“I’m still speechless,” he added. “But, I think this is quite a symbolic moment which may give hope to many of our activists who have been harassed by the police. The judge — for the first time in many years — refused to take police testimony as an absolute truth.”

Ahead of the hearing, Mr. Kasparov had mined social media sites for photographs and video documenting his arrest.

This is the police wrestling with Garry Kasparov inside the paddy van. Are they beating him? //t.co/kfn5QdYk — Olaf Koens (@obk) 17 Aug 12

Using this information, he argued that the police report was inaccurate, pointing to video evidence which showed that he was not chanting “Russia without Putin,” at the time as the police claimed.

He also produced a photograph of the original police report and time-stamped images of the officers dragging him away from reporters to prove that he was, in fact, arrested more than an hour before the time listed in the final police report.

754 images of my illegal arrest & beating by police. I’m sorry if the officer injured his hand hitting me in the head! //t.co/EoeAGmWT — Garry Kasparov (@Kasparov63) 19 Aug 12

Before the verdict came in, Mr. Kasparov said he was gratified that the judge had accepted the video and photographic evidence submitted in his defense, instead of relying solely on the police report. He said that the authorities were perhaps mindful of the fact that his arrest “had huge publicity, thanks to all the social networks and journalists,” who were present at the time.

After he was acquitted, Mr. Kasparov said that the judge’s ruling offered some hope for opposition activists charged with illegal assembly. Previously, he said, “police officers always had immunity to provide false testimonies.”

“Now the judge said, ‘No, they are contradicting each other.’ People who supported me, and, again, the journalists, who were so good in submitting all these video and photos today — I mean, they saved me today!”

Under a toughened law intended to tamp down on unapproved political protests, a guilty verdict against Mr. Kasparov could have resulted in a fine of nearly $1,000.

Despite Mr. Kasparov’s optimism, there is no reason to believe his case will change anything for other political opposition leaders, several of whom are under investigation or already facing prosecution.

Unlike some of the prominent young leaders of the opposition, like the anticorruption blogger Aleksei Navalny, Mr. Kasparov is not viewed as posing any serious threat to the government. Then, too, he occupies a very different category in the public imagination than the brash performance artists of Pussy Riot. He is still revered as a national hero by Russians who deeply respect chess skills.

Mr. Kasparov became the youngest world chess champion in history winning the title at age 22 in 1985. He retired from the game in 2005, and since then has been active in politics. He created an advocacy group called the United Civil Front, dedicated toward promoting electoral democracy in Russia, and also a political union called the Other Russia, in opposition to President Vladimir V. Putin. In 2007, he briefly ran for president himself.

Immediately after he was cleared on Friday, Mr. Kasparov said that he hoped this ruling would also “help me to demolish the stupid case on biting.” Mr. Kasparov scuffled with police officers at the time of his arrest and has been accused of biting one of the officers on the hand. The incident remains under investigation and was not part of the case decided on Friday. Mr. Kasparov, who insists the biting allegation is false, said he intends to sue the police for illegal arrest, assault and slander.

Outside the courtroom, Mr. Kasparov elaborated on the importance of the decision in remarks to reporters, which were translated into English and posted online by the Other Russia.

A remarkable day! Full statement in English will be posted soon. Заявление: //t.co/dBZNQvYf — Garry Kasparov (@Kasparov63) 24 Aug 12

Mr. Kasparov said:

I have a strange sensation, it’s hard to even find words for it, because my lawyers, friends and I didn’t expect anything besides another typical guilty verdict. And when, over the course of so many years, all opposition activists have been inevitably convicted in courts like this, it’s hard to imagine that the day would come when the courts could provide us with legitimate consideration. Actually, today was very unusual, because from the very beginning, as opposed to many other previous similar cases, the judge agreed to allow motions by the defense. Moreover, all of the defense’s motions were accepted, including those that called witnesses to the stand and those that entered video and photographic material as evidence. Of course, this was a very, let’s say, unusual sign, but we didn’t understand that it would influence the final verdict so much. I would like to express my particular gratitude to the journalists who managed to collect so many materials, especially photos and video, which were used in the case today and which absolutely had an influence both on the judge and, perhaps, on the people who have influence on the judge. It was just too obvious. I’d like to thank the journalists who came and appeared as witnesses here today, because it was clear that these people, who were completely different and of completely different nationalities, all said the exact same thing. It seems to me that this left an impression, and it also became obvious that, as opposed to many similar situations, there was no actual case of any sort of event occurring. And the extremely confused testimonies of the two police officers who detained me, which contradicted each other, they of course convinced the judge that their version of events held no credibility. The result was a full acquittal, and this is a very important step forward. I don’t intend to stop here; I want to have charges brought against the officers who illegally detained me. We’ve already filed the necessary paperwork with the investigative branch for the Khamovniki region. And I hope that this verdict will give us additional evidence so that my detention and beating will be given due consideration by investigators. As far as the next case is concerned, the one by Officer Ratnikov about this absurd attack – again, I hope that this today’s session will allow us to draw upon video and photo materials. We have very unique materials, basically an entire archive that allows us to give practically a second-by-second account of everything that happened outside of the Khamovnichesky Court. Again, my thanks to the journalists who managed to film all of this, to dig it all up from their electronic devices and even now continue to come forward with different photos and video clips. And I hope that the investigators will act just as objectively as this judge did today, and that I’ll be so lucky as to have Officer Ratnikov be convicted of libel. It’s hard for me to say what sort of consequences today’s verdict is going to have for the Russian opposition on the whole. I even feel slightly guilty, because until now all of these verdicts have been guilty ones, and so many of my friends are still experiencing this pressure. We know that the widespread investigation of the May 6th events on Bolotnaya Square is still ongoing. But nevertheless, this is a very important step forward, and I’m going to do everything in my power to help those who need defense in these matters, because not everyone is so lucky to have their detentions and the police violence they experienced be covered so fully by the press.

Ilya Mouzykantskii reported from Moscow, and Robert Mackey from New York.