Russian opposition politician Aleksei Navalny says he was briefly detained by police and accused of an administrative offense that could result in a 30-day jail term.

Navalny and a senior ally, Leonid Volkov, were both detained separately on February 22, weeks before a presidential election in which Navalny has been barred from challenging incumbent President Vladimir Putin.

The developments raised the prospect that Navalny and Volkov could be in jail during the March 18 election, which the vocal Putin foe is calling on Russians to boycott.

Hours later, Volkov tweeted that he had been sentenced by a court to 30 days in jail, meaning he will not be released until after the March 18 election, which Navalny is calling on Russians to boycott.

Navalny's press secretary, Kira Yarmysh, said Volkov had been found guilty of organizing illegal protests, and that it was "obvious" he was being punished for Navalny's calls for a boycott of the election.

Navalny tweeted that he had gone to the dentist because "my tooth hurt," and that police approached him as he was leaving the dentist's office and told him, "You're detained."

He later tweeted that he had been taken to a police station and then released after being served with notice that he was accused of repeated violations of what Kremlin critics say are draconian laws restricting public assembly.

Navalny, who has organized protests and published reports alleging corruption in Russia's ruling elite, has been prohibited from running in the election due to a conviction on financial-crimes charges he contends were fabricated.

He wrote on Twitter earlier in the day that Volkov, who headed his campaign before he was barred from the ballot, was detained at Moscow's Sheremetyevo airport. Volkov had been due to fly to the Bashkortostan region to meet with supporters.

Navalny has been detained numerous times and served short jail terms for organizing unauthorized protests and other alleged infractions.

He and other Kremlin critics say they suspect Putin's government wants to put him and his senior associates behind bars on or around election day in order to thwart their plans to hold more protests and monitor the vote for evidence of fraud.

"The [Kremlin's] aim is to neutralize the monitors and avert post-election protests," political scientist Yekaterina Shulman wrote on Facebook. She predicted the authorities would "isolate" Navalny and Volkov "on election day itself and immediately afterward."

Navalny was previously detained on January 28 on his way to a rally in Moscow that was part of a nationwide protests he organized to support his call for a boycott of the election, which he has dismissed as a farce and the "reappointment" of Putin.

Navalny said at the time that he suspected he was not brought to a court hearing right away because authorities wanted to make sure that he would be jailed for up to a month closer to March 18 in order to keep him behind bars on election day.

"If they jail me on January 28 then I will be released on February 28. But Putin wants me be isolated right on the eve of the election, and most likely on the day of the election. Therefore, I suppose they will jail me later to make sure that I am in a cell on March 18," Navalny wrote in his blog.

On February 20, police in Moscow detained Roman Rubanov, the chief of Navalny's Anticorruption Foundation, which has published the reports alleging graft among allies of Putin. A court ruled that he violated the law on public gatherings and handed 10-day jail term.