Russian opposition leader Alexei Navalny was today sentenced to five years in prison for theft.
His supporters said the unexpectedly tough punishment proved President Vladimir Putin was a dictator ruling by repression.
Navalny, an anti-corruption campaigner who led the biggest protests against Mr Putin since he took power in 2000, hugged his wife Yulia and his mother, shook his father's hand and then passed them his watch before being led away in handcuffs.
"Shame! Disgrace!" protesters chanted outside the court in Kirov, 900km northeast of Moscow.
Some supporters wept and others could barely hide their shock and anger.
State prosecutors had asked the court to jail Navalny for six years on charges of organising a scheme to steal at least 16 million roubles (€377,000) from a timber firm when he was advising the Kirov region governor in 2009.
But even a five-year sentence means he will not be able to run in the next presidential election in 2018 or for Moscow mayor in September as he had planned.
Some political analysts had expected the court to hand down a suspended sentence, to keep Navalny out of prison but rule out any political challenge.
The United States and European Union expressed concern over the conviction, saying it raised questions about the rule of law in Russia and Mr Putin's treatment of opponents.
In a last message from court, Navalny, 37, referred to Mr Putin as a "toad" who abused Russia's vast oil revenues to stay in power, and urged his supporters to press on with his campaign.
"Okay, don't miss me. More important - don't be idle. The toad will not get off the oil pipeline on its own," he wrote on Twitter.
Two people were detained in a small protest in Kirov.
At least 3,000 gathered near the Kremlin in Moscow and at least ten people were detained, with police going into the crowd to pluck out people who held up portraits of Navalny.
Some motorists honked their horns in support of the protests.
Rallies were also held in St Petersburg and Yekaterinburg in the Urals but no big clashes were reported.
Public support for Navalny is limited, and Mr Putin remains popular with many Russians.
The independent Levada polling group had put the opposition leader on only about 8% support in the Moscow mayoral election, but put Mr Putin's job approval rating at 63% in June.
Judge Sergei Blinov read the verdict rapidly and without emotion in the packed Kirov courtroom, hardly looking up as he took about three and a half hours to explain his conclusions.
"The court, having examined the case, has established that Navalny organised a crime and ... the theft of property on a particularly large scale," he said.
Pyotr Ofitserov, Navalny's co-defendant, was convicted as an accomplice and sentenced to four years in prison.
Navalny, a powerful orator who has accused the authorities of being "swindlers and thieves", stood in silence with a puzzled expression as he listened to the verdict.
He has ten days to appeal, and his lawyer, Vadim Kobzev, said he would do so.
The head of his campaign staff, Leonid Volkov, said Navalny had told him he would withdraw from the Moscow race if he was jailed, and that Navalny would make a statement about this tomorrow.
"There is no sense in taking part in it," Mr Volkov said.
Mr Navalny had said the charge against him was politically motivated and that the verdict would be dictated by Mr Putin.
He denied guilt and pointed out that an initial investigation, over accusations that he had pressured a state forestry company to agree to a disadvantageous deal with a middleman firm, had been closed for lack of evidence.
Since Mr Putin returned to the presidency after four years as prime minister, women from the punk band Pussy Riot have been jailed for a protest against him in Russia's main cathedral, and 12 opposition activists have gone on trial over violence that erupted at a protest on the eve of his inauguration in May 2012.
Another protest leader, Sergei Udaltsov, is under house arrest in what the opposition says is a crackdown on dissent.
The Kremlin denies that Mr Putin uses the courts for political ends, and the judge rejected Navalny's claim of political motivation.
Mr Putin's spokesman, Dmitry Peskov, did not immediately answer calls after the sentence was pronounced.
Opposition politician Boris Nemtsov, who attended the hearing, said he was "shocked". "With today's ruling, Putin has told the whole world he is a dictator who sends his political opponents to prison," Mr Nemtsov said.
Former finance minister Alexei Kudrin, a longtime Putin ally, saw the verdict as "an attempt to isolate him [Navalny] from society and the electoral process".
The US ambassador to Russia, Michael McFaul, said the United States was "deeply disappointed" and saw political motivations.
A spokesman for EU foreign policy chief Catherine Ashton said the charges had not been substantiated and this raised "serious questions" about the rule of law in Russia.