Russians have been voting in local elections that will test the popularity of President Vladimir Putin and his allies after a crackdown on opposition protests in Moscow.

Elections for municipal councils and regional governors took place across the country, but most attention was focused on Moscow, where tens of thousands took to the streets this summer after potential opposition candidates were barred from the vote.

Police detained hundreds of the protesters and while most were quickly released, some faced serious charges. In the week before the election, five were sentenced to jail time ranging from two to four years.

The opposition has called for voters to punish the Kremlin and the ruling United Russia party at the ballot box.

"Today we are fighting to destroy United Russia's monopoly," the country's main opposition leader, Alexei Navalny, told reporters after voting in the capital.

Mr Navalny's allies were excluded from the election over alleged irregularities so he has put forward a "Smart Voting" plan.

It calls for voters to back the politician, whatever their affiliation, who has the highest chance of beating pro-Kremlin candidates. Most of them are Communists.

Analysts say the vote is a test run ahead of parliamentary elections due in 2021 - both of the opposition's ability to mobilise support and the authorities' willingness to tolerate dissent.

Opposition activist Alexei Navalny after voting in today's Moscow City Duma election

The atmosphere in the capital was festive, as the city this weekend celebrated the annual Moscow City Day with street parties, balloons and mass dance routines.

But for some voters the mood was grim.

Alyona Prokhorova, a 46-year-old mother of four, said she was so disgusted by the summer crackdown that she signed up to be an election observer for the opposition.

"Moscow is against this hideousness," Ms Prokhorova said at a polling station in the city's southwest. "I still can't get over it."

She also said she backed Mr Navalny's strategic voting plan and her 18-year-old daughter would also cast a ballot for the candidate he suggested.

President Putin voted at his usual polling station at the Russian Academy of Sciences, where he appeared to dismiss the opposition's concerns about barred candidates.

"In some countries you have 30, 50, or 100" candidates, Mr Putin told reporters. "This doesn't change the quality of their work. It's quality not quantity that's important."

Lyubov Sobol, a lawyer for Navalny's Anti-Corruption Fund who was barred from running, said today's vote showed authorities had given up pretending that elections in Russia were democratic.

Protesters have been demonstrating against unfair elections throughout the summer

"This is the funeral for even the semblance of democratic elections," the 31-year-old who emerged as a key protest leader said after voting.

Tatyana Stanovaya, head of the R.Politik analysis firm, said the Moscow campaign exposed a growing rift between authorities bent on preserving the status quo and Russians wanting political change.

"The Moscow parliament elections have become a litmus test of the authorities' ability to accept this new reality," Ms Stanovaya said.

Muscovite Alexander Mayorov, 69, said he traditionally voted for Communists. Most United Russia members only "look out for themselves", he said, but he was also sceptical about Navalny.

United Russia, formed in 2001 to support Vladimir Putin, has seen its popularity collapse in recent years as incomes have fallen under Western sanctions. In Moscow, none of the pro-Kremlin candidates are running under its banner.

Some 7.3 million people were eligible to elect 45 lawmakers in the Moscow parliament. The city's mayor, Putin loyalist Sergei Sobyanin, was re-elected last year.

Elsewhere in the country, voters elected 16 governors alongside local assemblies.

Read more:
Over 1,000 arrested as Moscow rally calls for fair elections
Police detain almost 700 people at Moscow opposition protest

Political observer Kirill Rogov said the vote in Moscow was significant but that the "main event" was voting in the regions.

"Will we see a protest vote there or not? On what scale?" he said, stressing the importance of elections in Saint Petersburg, the Far Eastern city of Khabarovsk, and the Siberian cities of Irkutsk and Novosibirsk.

"Politics in Russia today is about big cities," Mr Rogov said.

The race for the governor's seat in Saint Petersburg will be closely watched, as acting city chief Alexander Beglov tries to at least avoid a potential second round run-off.

Mr Beglov is another close ally of Putin but is ridiculed by many in the city as gaffe-prone for his embarrassing jokes and missteps.

Thirty-year-old Anna Topilova said she voted for the opposition in the Saint Petersburg municipal elections but skipped the governorship vote.

"It's useless, I don't want to be part of it," she said.

Results in Moscow are expected to start trickling in after polls close at 8pm, with full figures due tomorrow.