A Russian court on Monday sentenced opposition politician Alexei Navalny, who wants to unseat Putin in next year's election, to 20 days in jail.
"This is a gift to Putin for his birthday," Navalny quipped in a Moscow courtroom.
The sentence is seen by Navalny's supporters as the latest attempt by the authorities to thwart his improvised election campaign, which has seen him travel around the country over the past months.
As a result, Navalny will not be able to lead a major rally he had planned in Putin's hometown of Saint Petersburg on Saturday, when the Russian leader will celebrate his 65th birthday.
In an address from the courtroom after the verdict, Navalny called on his supporters to use the occasion to take to the streets not only in Saint Petersburg but across the country.
"Do not give up, keep resisting," he said. "We do not want to see in power these impudent, hypocritical, deceitful, stupid loafers who fancy themselves gods. They are not gods. We are the masters of our country!"
The charismatic anti-corruption campaigner, 41, has said he wants to stand for president in the election next March, but electoral authorities have said he is not eligible because he is serving a suspended sentence for fraud.
He was detained on Friday as he was preparing to travel to a rally in the provincial city of Nizhny Novgorod.
He was accused by police of repeatedly violating a law on organising public meetings, which is punishable by up to 30 days in jail.
Authorities say Navalny and his supporters have not received permission from local officials to hold the Nizhny Novgorod rally, though Navalny claims it was authorised.
"This is an outrageous decision. We will appeal," one of his lawyers, Olga Mikhailova, said of the ruling. "It is unfair and unlawful and truly absurd."
Putin, who has led Russia since 1999, is widely expected to seek and win another six-year Kremlin term. The campaign has yet to officially open.
After Navalny declared his bid he was hit by a new wave of legal obstacles and attacks, and even had to travel to Spain for eye surgery after one assault left him almost blind in one eye.
He has been briefly imprisoned before, being detained before arriving at his last two rallies in Moscow on March 26 and June 12, both of which were not authorised by the city, serving 15 and 25 days.
Undeterred by the seemingly predetermined election outcome, Navalny has pressed ahead with his presidential bid.
He has been gathering crowds of supporters across Russia, seeking to shift public attitudes and battle political ennui in places such as the Pacific port of Vladivostok.
"Old man Putin is so scared of our rallies in the regions he's decided to make himself happy by giving himself a little gift for his birthday," Navalny tweeted after the ruling.
"It's safer this way."
Last month the Council of Europe's decision-making body, the Committee of Ministers, urged the Russian authorities to allow Navalny to stand for election despite his suspended sentence.
It said he and his co-defendant, former business partner Pyotr Ofitserov, continue "to suffer the consequences of their arbitrary and unfair convictions."
The Russian justice ministry accused the Council of Europe of putting political pressure on Moscow ahead of the elections.
Political analysts say that the growing atmosphere of intolerance towards dissenters has prompted a surge in radical feeling in Russia, with verbal threats from Kremlin supporters at times giving way to physical attacks.
But many have applauded Navalny -- whose ally Boris Nemtsov was assassinated in 2015 --- for his decision to keep up the fight at a time when many opposition figures have chosen to leave the country or stay quiet.