Russian activist Alexei Navalny has been freed from jail pending an appeal, a day after being sentenced to five years for embezzlement.
The court ruled that keeping Alexei Navalny in custody would deprive him of his right to stand in the mayoral elections in Moscow in September.
Thousands of Russians had protested against Alexei Navalny’s conviction, saying it was politically motivated.
Alexei Navalny, 37, is a vocal critic of President Vladimir Putin.
The elections in Moscow are set for September 8 and – for now at least – Alexei Navalny is being allowed to campaign.
On Thursday, Alexei Navalny was found guilty of heading a group that embezzled timber worth 16 million roubles ($500,000) from the Kirovles state timber company while working as an adviser to Kirov’s governor Nikita Belykh.
At the end of a three-hour verdict reading, Alexei Navalny was sentenced to five years in jail.
But on Friday, the Kirov regional court took just over an hour to hear the bail case and make its decision.
The three judges decided that, as Alexei Navalny had not breached his bail conditions during the trial, he should allowed to await the appeal decision at home in Moscow.
Alexei Navalny and his co-accused Pyotr Ofitserov were immediately released, and Navalny embraced his wife Yulia.
“I am very grateful to all the people who supported us, all the people who went to [protest on Moscow’s] Manezh Square and other squares,” he said.
It was not just the defense pleading Alexei Navalny’s case. In an unexpected move, prosecutors also pushed for him to remain free, with travel restrictions, pending his appeal.
Analysts said this could be an attempt by officials to soothe public anger over the case.
After the verdict on Thursday there were violent scuffles, as thousands of people took to the streets in Moscow, St Petersburg and other cities in protests that continued late into the evening. Reports said dozens were detained by police.
Other countries questioned the fairness of the verdict, with the EU saying it posed “serious questions” about the rule of law in Russia, while the US said it was “deeply disappointed”.
A spokesman for German Chancellor Angela Merkel said the trial had “raised doubts about whether criminal justice was the main motive”.
The Kremlin denies that Vladimir Putin uses courts for political ends, and the judge rejected Alexei Navalny’s claim that the trial was politically motivated.
Alexei Navalny is a leading campaigner against Vladimir Putin’s United Russia party and has regularly blogged about corruption allegations.
He came to public attention when he inspired mass protests against the Kremlin and President Vladimir Putin in December 2011.
Before he was led away to jail on Thursday, Alexei Navalny urged his supporters to continue his anti-corruption struggle, tweeting: “Don’t sit around doing nothing.”