A Russian court has released opposition leader Alexei Navalny from custody less than 24 hours after convicting him of embezzlement and sentencing him to five years in prison.
The release came after a surprise request by prosecutors, who said that because Navalny is a candidate in this autumn's Moscow mayoral race, keeping him in custody would deny him his right to seek election.
The release is to last until all appeals against his conviction are completed.
The charismatic anti-corruption blogger was found guilty of heading a group that embezzled 16 million rubles (£330,000) of timber from state-owned company Kirovles in 2009 while he worked as an unpaid adviser to the provincial governor in Kirov, about 470 miles east of Moscow.
That was the same year that Navalny, a lawyer, started an anti-corruption blog that attracted a wide following and made him one of the key figures of the nascent opposition to Vladimir Putin and the dominant United Russia party.
Navalny called United Russia "the party of crooks and thieves", a phrase that became a rallying cry. He was a leader of the wave of massive protest rallies that broke out in late 2011 after a national parliamentary election scarred by allegations of widespread fraud. More recently, he pushed his ambitions by declaring himself a candidate for the capital's mayoral election.
After the decision, he hugged his wife and thanked the several thousand supporters who had protested against his conviction on Manezhnaya Square next to the Kremlin, clapping hands and chanting "Freedom!".
Dressed in a black T-shirt and jeans, he said his release was a result of the protests. He claimed his conviction and sentence "had been vetted by the presidential administration ... but when people came out on Manezhnaya, they rushed to go back on that decision".
Judge Ignatiy Embasinov supported the release, saying that Navalny's incarceration would "prevent him from exercising his rights of being elected", to cheers from Navalny's supporters. The release comes with the condition that Navalny not travel outside Moscow and extends until appeals of his conviction are completed.
Navalny's lawyer, Olga Mikhailova, described the ruling as unprecedented in Russia. Navalny said it is "impossible to predict" whether the decision could raise the chances of his acquittal on appeal. He also said he has not yet decided whether to continue his mayoral campaign.