MOSCOW — Russian opposition leader Alexei Navalny, who has been barred from running in the next month’s presidential election, said he was briefly detained by police on Thursday.

Navalny said on his Twitter account that he was nabbed early Thursday afternoon as he was leaving a dentist’s office in Moscow. Less than an hour later he tweeted that he was taken to a police station where he was presented with charges of organizing an unsanctioned rally and released.

There was no official confirmation and it was not immediately clear when he would appear in court.

Navalny, who is President Vladimir Putin’s most formidable foe, spearheaded protest rallies last month, calling for a boycott of the upcoming presidential vote. He was briefly detained at a Jan. 28 protest in Moscow but police did not immediately bring any charges against him.

Navalny’s allies speculated that police would delay charging him to allow authorities to keep him behind bars on the election date, March 18.

Navalny mounted a nationwide grass-roots presidential campaign last year, tapping into the discontent in Russia’s once politically dormant provinces which have traditionally voted for Putin. The anti-corruption campaigner was denied a place on the ballot in December because of a fraud conviction that many view as politically motivated.

Separately, Navalny’s campaign chief Leonid Volkov said he was detained at a Moscow airport earlier on Thursday. His whereabouts were not immediately clear.

Navalny’s boycott campaign is worrisome for the Kremlin, which fears that a lower voter turnout would be seen as a sign of declining support for Putin.