MOSCOW — Not even 24 hours after a judge ordered him handcuffed and imprisoned to begin a five-year sentence for embezzlement, the Russian political opposition leader, Aleksei A. Navalny, walked free — temporarily, at least, pending an appeal.

It was a head-spinning turn that gave Mr. Navalny new grounds to challenge the authorities, thrilled his supporters — prematurely, perhaps, as he remains convicted of a serious crime — and set off speculation about the government’s motivations and goals in jailing and then freeing President Vladimir V. Putin’s chief antagonist. His release was requested by the same prosecutor who had asked that he be locked up in the first place.

In the Kremlin’s first comments on Mr. Navalny’s sentence, Mr. Putin’s spokesman, Dmitri S. Peskov, reiterated the longstanding position that the president and politics do not influence the courts in Russia.

Mr. Peskov said the president was aware of the ruling but would not comment. “The president does not make and cannot make any judgments about court rulings,” he told reporters, according to the Interfax news agency. “Court rulings need to be respected.”