Russia's opposition leader, Alexei Navalny, said he had been detained by police weeks ahead of a presidential election in which he has been barred from running.

Mr Navalny, who is Vladimir Putin's most visible and vehement foe, said on his Twitter account he was detained after visiting the dentist.

"They are taking me somewhere," he said.

Russia opposition leader Alexei Navalny detained by police at anti-Putin protest

The anti-corruption campaigner has been repeatedly jailed for organising unauthorised protest rallies throughout the country.

He aimed to run for president in next month's election, but was denied a place on the ballot because of a fraud conviction many view as politically motivated.

Mr Navalny was released by police less than an hour after he was detained in Moscow.

He tweeted to say he had been released and given a document on legal procedures against him for organising illegal protests.

"They offered me a lift somewhere, but I declined and have gone to work," Mr Navalny tweeted. "I don't understand what happened, and why it took seven people to detain me."

If found guilty, he faces up to 30 days in jail.

Russia protests on Vladimir Putin’s birthday Show all 12 1 /12 Russia protests on Vladimir Putin’s birthday Russia protests on Vladimir Putin’s birthday An opposition activist wearing a rubber mask depicting Russian President Vladimir Putin walks past gift boxes with lettering reading “trial”, “resignation”, “impeachment”, “true election” and others during an event dedicated to Putin’s 65th birthday in downtown Moscow, October 7 2017 AFP/Getty Russia protests on Vladimir Putin’s birthday Demonstrators holding yellow ducks are interviewed by journalists as they arrive for the rally AP Russia protests on Vladimir Putin’s birthday A demonstrator chats slogans during the unauthorized anti-Kremlin rally called by jailed opposition leader Alexei Navalny AFP/Getty Russia protests on Vladimir Putin’s birthday Demonstrators shout slogans and wave Russian flags during the rally in Moscow AP Russia protests on Vladimir Putin’s birthday Demonstrators in downtown Moscow hold a poster which reads “We demand a fair election”. AFP/Getty Russia protests on Vladimir Putin’s birthday Demonstrators walk down Tverskaya street during the unauthorized anti-Kremlin rally AFP/Getty Russia protests on Vladimir Putin’s birthday Riot police block an area AFP/Getty Russia protests on Vladimir Putin’s birthday Demonstrators clench their fists during the rally. Opposition leader Alexei Navalny has worked to organize protests in support of his presidential bid across Russia on Saturday AP Russia protests on Vladimir Putin’s birthday Demonstrators gather near a monument of Russian poet Alexander Pushkin AFP/Getty Russia protests on Vladimir Putin’s birthday Demonstrators march and wave a Russian flag AFP/Getty Russia protests on Vladimir Putin’s birthday A topless activist from the feminist group Femen depicts American actress Marilyn Monroe singing the “happy birthday” song EPA Russia protests on Vladimir Putin’s birthday “On the birthday of Russian dictator Vladimir Putin, Femen wants to remind the world of the threat that it bears to all of us, and not only to those countries where it has now launched bloody wars,” Femen said. AFP/Getty

Mr Navalny, a 41-year-old anti-corruption campaigner who organised some of Russia's biggest protests of recent years, says he has been unfairly barred from contesting the 18 March presidential election over what he says is a trumped-up suspended prison sentence.

Mr Putin is widely expected to win the contest, but Mr Navalny has called for a nationwide boycott aimed at undermining the President's legitimacy by bringing the turnout down.

Mr Navalny's detention came shortly after his campaign chief, Leonid Volkov, also said on Twitter he had been detained by police at Moscow's Sheremetyevo airport.