Moscow's pro-Kremlin mayor was set to win tight elections Sunday in the Russian capital, just escaping a second-round run-off after a strong challenge from protest leader Alexei Navalny, who denounced the results as falsified.

Initial results showed that Sergei Sobyanin, a leading ally of President Vladimir Putin, would narrowly win in the first round with just over half the vote after Navalny unexpectedly picked up over a quarter of the ballots.

In a nationwide day of local polls that may worry the Kremlin, opposition anti-drugs campaigner Yevgeny Roizman defeated the pro-Kremlin candidate in elections for Russia's fourth largest city Yekaterinburg.

In Moscow, Sobyanin was winning 51.4 percent of the vote with Navalny on 27.2 percent, the Moscow election commission said in a count based on over 80 percent of polling stations reporting.

But Navalny, 37, insisted he had managed to force the mayor into a second round and threatened street protests if the authorities did not acknowledge Sobyanin had polled less than 50 percent.

"What we are seeing now are clear falsifications," he told reporters in a late night briefing at his campaign headquarters in Moscow.

"We demand that a second round is held. If that is not done... we will appeal to the citizens and ask them to take to the streets of Moscow."

The candidacy of Navalny -- who campaigned under the shadow of a conviction in a controversial embezzlement case -- made the race the first genuinely competitive Russian election since the heady early post-Soviet years.

In a late-night rally in central Moscow attended by thousands and lit up by fireworks, Sobyanin had said he was sure of victory and congratulated himself for organising "the most honest and open elections in the history of Moscow".

"We have something to be proud of," he told the cheering supporters.

But turnout was low at 26.5 percent as of 1400 GMT, an unusually slack figure, which indicated Navalny had been far more successful at bringing out his supporters than the mayor, who ran a supremely low-key campaign.

Communist candidate Ivan Melnikov was third in the partial results with just over 10.6 percent of the vote, while other contenders merely made up the numbers.

-- 'A victory for Navalny' ---

The election was seen as a crucial test of the protest mood in the city, which was shaken by huge demonstrations against Putin's decade-long rule in the winter of 2011-2012.

"This is a victory for Navalny, the results he's received are very good, even if there will be no run-off," Gleb Pavlovsky, a political analyst and one-time Kremlin consultant, told AFP.

Putin, who has made no secret of his support for his former Kremlin chief of staff Sobyanin, 55, said when he cast his vote that Moscow did not need a "politician" for a mayor and that "technocrats" were better.

Moscow gave Putin a relatively low 46.95 percent of the vote in the 2012 presidential election, well below the nationwide average.

Navalny had threatened protests if officials rigged the vote and thousands of supporters are due to hold a meeting on Monday evening in a central Moscow square to decide their strategy.

In the run-up to the vote, Navalny shook up Russian politics with a Western-style political campaign that made savvy use of the Internet and secured more than 100 million rubles ($3 million/2.3 million euros) in donations.

By contrast, buttoned-up Kremlin functionary Sobyanin avoided overt political rhetoric and shunned television debates, instead focusing on sprucing up the capital of 12 million people.

In July, Navalny was sentenced to five years in a penal colony on fraud charges that he says were trumped up. He was arrested in court, but suddenly released a day later pending his appeal.

"The question is, what will they do to Navalny now," said Nikolai Petrov, an analyst with the Higher School of Economics.

"I think his term will be commuted to a suspended sentence -- this will prevent protests from flaring up and will also exclude him from politics for some time."

In Yekaterinburg, Roizman was winning 33 percent of the vote while the candidate of the ruling United Russia Party, Yakov Silin, had 30 percent, the local elections commission said, in results based on reports from 500 of the 565 polling stations.

Unlike the parallel mayoral election in Moscow, the Yekaterinburg poll is taking place in one round with the winner taking all.

Should Roizman be confirmed as the winner, it will be one of the first times in Russian history an opposition candidate has beaten the ruling-party figure in a city this size.