Russia unexpectedly freed opposition leader Alexei Navalny on bail on Friday, bending to the will of thousands of protesters who denounced his five-year jail sentence as a crude attempt by President Vladimir Putin to silence him.
In a highly unusual ruling that points to Kremlin uncertainty over how to handle Navalny's case and new protests, a judge approved the prosecution request to free him pending his appeal so that he can run in a Moscow mayor election on September 8.
The anti-corruption blogger will be unable to leave Moscow but hailed the decision, a day after he was convicted of theft, as a victory for people power. Experts said it was unprecedented for the prosecution to seek bail on such terms after sentencing.
"I am very grateful to all the people who supported us, all the people who went to (protest in Moscow's) Manezh Square and other squares," the 37-year-old said, rushing across the court to hug his wife after he was let out of a glass courtroom cage.
The judge's decision was greeted by applause in the court in Kirov, 900 km (550 miles) northeast of Moscow. Under Russian law, he has 10 days to file an appeal and then the court has to decide whether to hear that appeal in 30 days.
"We understand perfectly well what has happened now. It's an absolutely unique phenomenon in Russian justice," Navalny said.
People poured onto the streets of big Russian cities to protest on Thursday evening after Navalny was convicted of stealing at least 16 million roubles ($494,000) from a timber firm when he was advising the Kirov regional governor in 2009.
More than 200 people were detained although the rallies were peaceful, with demonstrators chanting "Shame!", "Freedom!" and "Putin is a thief!"
In Moscow, drivers honked their horns in support as they drove past at least 3,000 demonstrators a few hundred meters from the Kremlin's red brick walls.
Navalny says his trial was politically motivated and intended to sideline him as a threat to Putin, even though his support is limited outside the cities and opinion polls show the president is still Russia's most popular politician.
Navalny led anti-Putin protests in Moscow which attracted tens of thousands of people at their peak last year. But they did not take off in the provinces, Putin's traditional power base, and faded after the former KGB spy was elected to a six-year third term as president in March 2012.
The sight of protesters so close to the heart of power on Thursday may have unsettled the Kremlin, and Friday's bail decision could be a political maneuver to head off new protests that would worry investors.
The judge ruled that keeping him in detention put "him on an unequal footing against other candidates (in the mayoral election) and restricts his right to be elected".
The current mayor, Sergei Sobyanin, a close Putin ally, said he would prefer to be challenged by Navalny, who opinion polls show is trailing him by a long way.
A source close to the mayor said Sobyanin, who is tipped as a potential prime minister, was worried the removal of Navalny as a candidate would tarnish his expected victory.
Some analysts said the Kremlin, and the business and security community around it, looked divided over Navalny.
"There really is a split in the elite and it seems there will be no peaceful outcome," said political scientist Ella Paneyakh, who described the bail request by the state prosecution as unprecedented.
SPLITS IN THE KREMLIN?
Putin is under no immediate political threat from Navalny, or any other opposition figure, but his grip on power has long depended on maintaining calm and a balance of forces between the conservatives and more liberal forces around him.
Cracks in the facade of unity have appeared, particularly over the removal from government of Vladislav Surkov, Putin's former political strategist, in May. Surkov had fallen foul of more hawkish Kremlin allies who are in the ascendancy as Putin takes a tough line against opponents after last year's protests.
"I think the split at the top of the Kremlin pyramid has now become absolutely obvious," said Alexei Roshchin, a veteran campaign adviser and sociologist.
"Before our very eyes the Navalny case is acting as a catalyst for the split in the elites."
The Kremlin has not responded to calls for comment on the verdict and said nothing about Friday's ruling. It says it does not use the courts for political ends.
The United States and European Union voiced concern over Navalny's conviction, saying it raised questions about the rule of law and Russia's treatment of Putin's opponents.
"The fact that they were released under specific conditions is something that we can welcome, but how the whole case has been handled simply underlines our concerns," a spokeswoman for EU foreign policy chief Catherne Ashton said.