The world did a double-take watching prosecutors in Russia's Kirov Oblast do their own about-face on July 19 by requesting that opposition politician Aleksei Navalny be released from custody pending an appeal against his embezzlement conviction.
Just a day earlier, the same prosecutors had been demanding that Navalny -- and co-defendant Pyotr Ofitserov -- be immediately taken from the court in handcuffs.
At the Kirov Oblast Court hearing on the prosecutors' request that he be released, the ever-witty Navalny even joked that some sort of body-snatcher thing had happened to prosecutor Sergei Bogdanov because "it was prosecutor Bogdanov who demanded my detention in court."
Leaving aside the theory that prosecutors have been replaced by aliens, what could be going on?
Navalny's conviction itself came just 24 hours after election authorities in Moscow registered him as a candidate in the city's September 8 mayoral election, making him the strongest opposition candidate running against Kremlin-backed incumbent Sergei Sobyanin.
Not only was the prosecutors' request to soften the terms of Navalny's confinement surprising, but the fact that the regional court agreed to hear the appeal the day after it was filed was also a sign that something very unusual was happening.
Russian lawyers were stunned by the events. Attorney Robert Zinoviyev told Gazeta.ru that he could not think of a single comparable case. Lawyer Vadim Klyuvgant told the same online publication
that he believed prosecutors did not even have the legal right to appeal that part of the court's decision since they themselves had requested that the defendants be taken into custody immediately.
For his part, Navalny, in a blog post that appeared shortly after his release, said the authorities' change of heart was a direct result of the protests in Moscow and other cities following the July 18 verdict against him.
"Thank you all who, with your solidarity, forced them to release Pyotr and myself," Navalny wrote.
However, that could perhaps be seen as political wishful thinking, considering that the authorities rather effectively controlled the relatively small -- albeit quite brave and intense -- show of support
on the streets.
Other analysts see a connection between Navalny's release and the Moscow mayoral campaign. In announcing his decision, Kirov Oblast Court Judge Ignatiy Embasinov maintained that the lower court should have taken this into consideration before ordering Navalny's imprisonment.
"Navalny's incarceration over the course of the election campaign places him in an unequal position with respect to other registered candidates and restricts his right to be elected," he said.
Embasinov did not say how this reasoning applied to Ofitserov, Navalny's co-defendant who was also released pending his appeals.
Moscow-based political analyst Mikhail Vinogradov told RFE/RL's Russian Service that Sobyanin wanted to run against Navalny in order to boost the public perception of his own legitimacy -- or at least, his willingness to appear to participate in a competitive election.
The speculation in Moscow is that relatively hard-line forces connected to the security forces -- the so-called siloviki -- have pushed for Navalny's prosecution and his immediate imprisonment, probably in order to put an end to the blogger's revelations of high-level corruption.
On the eve of his sentencing, for instance, Navalny posted a long and detailed indictment against Vladimir Yakunin, a close friend of President Vladimir Putin and the head of the state company Russian Railways.
But Sobyanin has said he wants Navalny to run and has even used his influence to help Navalny overcome various administrative hurdles in his registration. It is possible Sobyanin was disconcerted by statements from Navalny's campaign following his sentencing that he would withdraw from the election and that his staff would instead urge voters to boycott the election.
After Navalny's release, Sobyanin told journalists, "it is necessary to do everything possible so that all registered candidates continue to participate in the election."
Analyst Vinogradov, however, stressed that Sobyanin's enthusiasm for Navalny's participation has limits. "Navalny's participation in the election suits [Sobyanin], although the intrigues around the question of how much access Navalny will be given to television will likely now become sharper," he said.
"After all, Navalny wasn't allowed on television on the national channels even when [opposition leaders Boris] Nemtsov and [Sergei] Udaltsov were," Vinogradov added. "There is a definite fear about letting Navalny appear on television, although it is still unclear whether Navalny himself is capable of using such opportunities to gain followers in new categories, such as pensioners."
Nemtsov himself urged Navalny to continue his mayoral campaign, saying, "if he gets more than 1 million votes in the election, the authorities won't dare to put him in prison."
RFE/RL Russian Service correspondent Svetlana Pavlova contributed to this report from Moscow