MOSCOW - A Russian court on Monday sentenced top opposition politician Alexei Navalny, who wants to unseat President Vladimir Putin in next year's election, to 20 days in jail over repeatedly violating a law on organising public meetings.

"This is a gift to Putin for his birthday," Navalny quipped in a Moscow courtroom.

The sentence means Navalny will not be able to lead a major rally he had planned to stage in Putin's hometown of Saint Petersburg on Saturday, when the Russian leader will celebrate his 65th birthday. Navalny, the 41-year-old charismatic anti-corruption campaigner, was detained on Friday as he was planning to travel to a rally in a provincial city.

He was accused by police of repeatedly violating a law on organising public meetings, which is punishable by up to 30 days in jail.

Navalny has said he wants to stand for president in the election next March, but the electoral authorities have said he is not eligible because he is serving a suspended sentence for fraud.

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.

Navalny has been briefly imprisoned before. He was detained prior to arriving at his last two rallies in Moscow on March 26 and June 12, both of which were not authorised by the city.

He served sentences of 15 days and 25 days for organising unauthorised protests.

Undeterred by the seemingly predetermined election outcome, Navalny has pressed ahead with his presidential bid and travelled around the country.

Navalny 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 and other cities.

"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."