MOSCOW — Vladimir Putin’s ruling party had its majority in Moscow’s city legislature slashed by nearly half in an election shock that came after a summer of protests over the barring of some of the Kremlin’s fiercest critics from the ballot.

United Russia’s candidates won 25 of the City Duma’s 45 seats, down 15 from the 40 the party previously held. The Communist Party claimed 13 seats, while the center-left A Just Russia party took three seats. Although both parties are nominally in opposition to United Russia, analysts say they are controlled by the Kremlin to varying degrees.

Yabloko, a tiny perestroika-era liberal party, won four seats. Its leader Sergei Mitrokhin was initially banned from standing at the polls but was reinstated after a court in Moscow ruled in his favor. “This is a massive achievement,” said Vitali Shkliarov, a political analyst who advised the party. Shkliarov added it is the first time genuine opposition candidates have been elected to the City Duma since the early 1990s.

Members of United Russia ran as “independents” in Moscow in an apparent bid to distance themselves from their increasingly unpopular party, after its ratings plummeted amid an increase to the national pension age and growing poverty. But neither that tactic nor reported voter fraud in favor of United Russia could save one of the party's heavyweights: Andrei Metelsky, the leader of United Russia’s branch in Moscow, lost his seat on Sunday.

Government-loyal officials prevented over a dozen liberal opposition figures associated with Alexei Navalny, the prominent opposition politician, from standing at the City Duma polls. The Kremlin reportedly took the decision after internal polling revealed the liberals were poised to win at least nine seats. While the City Duma is not particularly powerful, officials were thought to be concerned about allowing Navalny’s allies a wider platform for their anti-Kremlin views.

“These weren’t real elections — lots of candidates who would clearly have won weren’t allowed to run” — Dariya Besedina

The decision to keep them off the ballot sparked a series of opposition rallies in Moscow that saw over 2,500 people arrested by baton-wielding riot police. Lyubov Sobol, an aspiring opposition candidate, said on Sunday that the City Duma polls represented “a funeral for even the illusion of democracy.”

Navalny hailed Sunday’s election result as a success for his controversial strategic voting tactics. He had portrayed the polls as a referendum on United Russia’s popularity and appealed to voters to back the candidates most likely to defeat those from Putin’s party. He and his supporters launched a "Smart Voting" website, app and bot to publicize the strategy. “We can say clearly that in Moscow this result is a triumph for Smart Voting,” Navalny said as the scale of United Russia’s losses emerged.

In most cases, however, Navalny’s tactics meant voting for Communist Party or A Just Russia candidates, something some liberal Russians said they could not bring themselves to do, even to spite Putin’s party. Viktor Shenderovich, a popular writer, said the tactics were unethical and "self-defeating."

Although it is impossible to judge how much influence Navalny’s Smart Voting strategy had on the vote, a number of triumphant candidates acknowledged their debt to the opposition leader’s backing, and noted that had candidates affiliated with him been allowed to run, they would have won instead. Yandiev Magomet, who defeated United Russia’s candidate in central Moscow, admitted that in a fair vote he would have lost to Ilya Yashin, a blacklisted opposition politician. Yashin had a 28-percentage point lead before he was barred from the race, according to an opinion poll.

“These weren’t real elections — lots of candidates who would clearly have won weren’t allowed to run,” Dariya Besedina, a triumphant Yabloko candidate, wrote on Twitter. She said she would call for the City Duma to disband itself at its first session.

The other ballots

Besides the high-profile City Duma poll in Moscow, Russians were also voting for the heads of 16 regions, as well as for lawmakers to 13 regional parliaments. There was drama on the eve of the elections when masked men on horseback opened fire at a van carrying election monitors and journalists in Tuva, in southern Siberia. No one was injured.

In St. Petersburg, the incumbent governor, Alexander Beglov, looked set for reelection amid allegations of ballot stuffing. Beglov, the former head of United Russia in the city, stood as a so-called independent candidate. Five other United Russia governors running for reelection also triumphed on Sunday after standing as independents.

Putin’s party suffered a big loss in the Khabarovsk region, in Russia’s far east, where the nationalist Liberal Democrat Party of Russia (LDPR) recorded a landslide victory. Just two United Russia candidates were elected to the 35-seat regional parliament. The result comes after the LDPR triumphed at last year’s governor elections in the region. In Irkutsk, eastern Siberia, United Russia lost its majority.

Russian officials accused Facebook and Google of interfering in the elections by allowing political advertising on their websites on Sunday. Russian state communications watchdog Roskomnadzor said it had asked the tech giants to prevent such advertising on the eve of the elections, in accordance with Russian law. “Such actions can be seen as interference in Russia’s sovereign affairs,” the watchdog said. Russian government officials had previously accused Western countries of encouraging the election protests in Moscow this summer.

This story has been updated with new results.