A Russian court on Friday released opposition leader Alexei Navalny from custody less than 24 hours after he was convicted of embezzlement and sentenced to five years in prison.

The release came after a surprise request by prosecutors, who said that because Navalny is a candidate in this fall's Moscow mayoral race keeping him in custody would deny him his right to seek election.

The release, under the condition that he not travel outside Moscow, will extend until appeals of his conviction are completed.

After the Friday decision, a smiling Navalny emerged from the caged-off defendants' section of the courtroom and thanked supporters who held protest rallies on Thursday after his conviction.

Presentation of the appeal and the decision by the court for the Kirov region took little more than an hour, a sharp contrast to the droning 3 ½-hour verdict reading and sentencing in a lower court the previous day.

Navalny, a popular blogger and corruption-fighting lawyer, rose to prominence among the opposition during a series of massive protests in Moscow against President Vladimir Putin's re-election to a third presidential term in March 2012.

The conviction prompted criticism from the United States and the European Union.

Navalny began his rise to prominence by blogging about his investigations into corruption at state-owned companies where he owned shares, reaching hundreds of thousands of people. He and his team of lawyers and activists have plumbed property registers abroad to identify top officials and lawmakers who own undeclared foreign assets and hold foreign citizenship.

Navalny's blog quickly became an Internet sensation not only because of his exposures but because of its engaging illustrations, funny images and witty catchphrases. It was Navalny who first called the dominant United Russia party "the party of crooks and thieves," a phrase that still dogs Kremlin loyalists.

The opposition leader's investigations targeted a wide circle of Putin loyalists — from members of Parliament to state bankers — threatening to discredit the system of governance he has built.