MOSCOW — Many Russian politicians cheered Britain's exit from the European Union on Friday, declaring the results a triumph of democracy and a failure of Western leadership that may help Russia rebuild ties with Europe after two years of economic sanctions.

With Britain seen here as a primary source of perceived anti-Russian sentiment in Europe, Sergei Sobyanin, the mayor of Moscow, said that "without Great Britain in the E.U., no one will so zealously defend the sanctions against us."

Some saw the vote as a more momentous geopolitical realignment. Boris Titov, the Kremlin's small-business ombudsman, said in a Facebook post that "it seems it has happened — UK out!!!"

"In my opinion, the most important long-term consequence of all this is that the exit will take Europe away from the anglo-saxons, meaning from the USA. It's not the independence of Britain from Europe, but the independence of Europe from the USA," he wrote.

"And it's not long until a united Eurasia — about 10 years," he concluded.

Russian President Vladimir Putin, who is currently in Tashkent for a summit of the Shanghai Cooperation Organization security bloc, had not commented on the results by noon on Friday. Sergei Lavrov, the Russian foreign minister, told reporters that the vote was the "internal affair of the British people." Moscow has offered similar language in the past when its own elections have been criticized.

"Moscow is certainly interested in the E.U. remaining a major economic force — prosperous, stable and predictable," Dmitry Peskov, Putin's spokesman, said on Friday.

Aleksey Pushkov, the hawkish chairman of the foreign affairs committee in Russia's lower House of Parliament, took aim at critics who said that Russia had influenced the vote. "One need not shift the blame: Russia had nothing to do with this. This is the defeat of the opponents of Brexit themselves. And the personal failure of Barack Obama."

Other officials, particularly those concerned with the economy, sounded notes of caution.

"I don't share the simple view that what's worse for them is better for us," said Konstantin Kosachev, the head of the committee for foreign affairs in Russia's upper House of Parliament. "If the E.U. gets weighed down in its own problems, and crosses the line into crisis, then it will affect our trade relations."

The Russian Central Bank said in a statement that the reaction on financial markets did not carry a direct risk to the Russian economy, although the ruble and Russian markets fell on Monday morning.

Aleksei Kudrin, a former minister of finance who is seen as close to Putin and liberal, said in a tweet that "Brexit will not seriously have an effect on Russia. We have our own, more sensitive, problems."

In another tweet, Kudrin added: "One can regret the decision of the British to leave the E.U. But there will be no catastrophe, although there will be some short term instability on the financial markets."