Kremlin-backed candidate Sergei Sobyanin is set to win the election for mayor of the Russian capital Moscow, but by a narrow margin.
But his main rival, pro-democracy movement leader Alexei Navalny, fared better than expected with 27% so far.
The charismatic politician has already called for a run-off, saying the results were “clear falsifications”.
Mr Sobyanin won about 52%, thus taking victory in the first round, partial official results indicate.
Sometimes even when a candidate loses an election, they are still a winner. Only seven-and-a-half weeks ago Alexei Navalny was sitting in prison, a convicted criminal claiming political persecution who was then released pending his appeal.
When he started campaigning the opinion polls were predicting he would get less than 10% of the vote. But he knew that a significant proportion of Moscow was looking for a new kind of politics, and he took to the streets to meet the voters, something Muscovites had not seen in years.
Deprived of access to state-controlled TV, he fought using the internet and word-of-mouth. Although President Vladimir Putin’s candidate Sergei Sobyanin has still beaten him, this result was much less comfortable than the Kremlin expected, and will force a further rethink of its strategy in Moscow.
It is only the beginning of Alexei Navalny’s career as a conventional politician – if it is not cut short again by him being returned to prison.
According to the electoral commission, Mr Navalny has so far won some 27% based on over 80% of polling stations reporting.
However, the pro-democracy leader has strongly disputed the results, and says he won enough votes to force a run-off.
“What we are seeing now are clear falsifications,” he told reporters in a late-night briefing on Sunday.
“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.”
Mr Navalny is currently on bail after being found guilty of embezzlement in what he insists was a political trial.
If there is any serious suggestion of the election being rigged, large-scale protests will probably return to Moscow’s streets, the BBC’s Daniel Sandford reports from Moscow.
In other mayoral votes on Sunday, anti-heroin campaigner Yevgeny Roizman appears to have won by a narrow majority in Yekaterinburg, the main city in Russia’s Urals industrial zone.
Mr Roizman, a former MP often critical of Kremlin policy, won 32% to 30% for the ruling party candidate Yakov Silin, according to partial results. Unlike Moscow, the city’s mayor is elected by a simple majority in a single round.
Mr Navalny earlier told reporters that he would “not give up a single vote that we received”.
“Right now Sobyanin and his main supporter Vladimir Putin are deciding whether to have a relatively honest election and to have a second round, or not,” he added, as partial results were still coming in.
Mayoral elections were abolished in Moscow in 2004 but re-instated as a concession to pro-democracy campaigners.
In late 2011, Moscow was the scene of the biggest anti-government protests since Soviet times after a general election marred by allegations of ballot-rigging.
Mr Navalny ran a Western-style campaign, holding informal meetings with voters outside metro stations and using glossy posters of himself with his family.
He is credited with bringing grassroots politics to the Russian capital, inspiring thousands of volunteers to support his campaign.
Mr Sobyanin became mayor in 2010 after Yuri Luzhkov, who had governed the city for almost two decades, was forced out of office.
The Kremlin-backed candidate has kept a low profile during the race, shunning debates with the five other candidates.
In all, six candidates stood in the election.