MOSCOW -- Heads were spinning Friday when a Russian court ordered the release of opposition leader Alexei Navalny and his former business partner the day after convicting the men of embezzlement and sending them to prison in handcuffs.

“From the procedural point of view, what happened was totally by the book, but in terms of Russian judicial practice it was kind of unique,” said Tamara Morshchakova, a former deputy chair of the Constitutional Court. “I can hardly remember a case when prosecutors asked for the release of a convicted person the day after getting the sentencing they were working for.”

So what happened? There are a number of theories.

Nikolay Svanidze, a popular television anchor and member of the Presidential Council on Civic Society and Human Rights, said the Russian judicial system is essentially an extension of the government and probably was following instructions from the Kremlin.

“The fact that Navalny was ordered to be released the next day can only mean that the Kremlin was taken aback by the quick and uniformly negative reaction of the world political establishment and by a spontaneous and massive response from thousands of young people in Russia who joined protest actions in many cities and towns across the country,” Svanidze told The Times.

He said Russian President Vladimir Putin can't afford to be seen to be suppressing civic society on the eve of a visit by President Obama and with the Winter Olympics coming to Sochi in 2014. The United States and a number of other Western governments had expressed concern about what they termed an example of biased, politically motivated justice.

“There must be some real infighting between two different factions in the Kremlin over what line to pursue toward Navalny and the opposition in general,” Svanidze said. “Or else the Kremlin doesn’t have a clue what to do next, and hence the embarrassing convulsions.”

Lilia Shevtsova, a senior researcher with Moscow Carnegie Center, suggested another reason. Navalny, a lawyer and popular blogger, was a candidate in the Moscow mayoral election in September. Although he garnered just 8% support in recent opinion polls, excluding him could taint a likely win by Putin’s preferred candidate, the president’s former chief of staff and Moscow’s acting mayor, Sergei Sobyanin.

Shevtsova said Putin is still “testing the water” and figuring out the degree of repression he can get away with.

“They realized at some point that they can still use Navalny to legitimize the forthcoming Moscow mayoral election and put him in prison later, when he loses at the polls,” she said.

The official reason provided by the court was that Thursday’s verdict did not take into account Navalny’s candidacy and that he should be allowed to campaign while a decision is made on his appeal. There was no reason to suspect that “the convict may hide away … continue his criminal activities, destroy the evidence or hamper the investigation in any other way,” the court said.

Sobyanin welcomed the court’s decision. “We have done our best to register him, so that Muscovites could have more options,” he told reporters Friday.

Navalny has been an outspoken critic of Putin, calling the Russian leader a thief and his party, United Russia, a group of swindlers and thieves. The criticism contributed to the ruling party's humiliating 50% showing in parliamentary elections in December.

On Thursday, a district court in the regional capital of Kirov sentenced Navalny and his former business partner, Pyotr Ofitserov, to five and four years in prison respectively, and a $15,000 fine each for allegedly embezzling the equivalent of $530,000 from a local timber company in 2009.

A Justice Department investigation will allege sweeping patterns of discrimination within the Ferguson, Mo., Police Department and at the municipal jail and court, a law enforcement official familiar with the report said Tuesday.