MOSCOW — Allies of President Vladimir V. Putin of Russia suffered significant losses in Moscow City Council elections, preliminary results showed on Monday, but mostly held their own in other local polls across the country.
Results of the elections, held on Sunday, highlighted the Kremlin’s troubles in the Russian capital, which has been roiled in recent weeks by a wave of protests, while demonstrating its firm grip on politics elsewhere in the vast country.
The governing United Russia party will still form the majority in the city legislature of 45 seats, but the results showed the party’s continuing weakness, as well as the seeming effectiveness of the opposition’s “smart voting” effort, which sought to consolidate voting behind the antigovernment candidate with the best chance of winning.
Beyond Moscow, the Kremlin was still able to demonstrate its full control of the political situation, winning all 16 of the governor’s races. In St. Petersburg, Mr. Putin’s longtime associate, Aleksandr D. Beglov, who was described by Russian news outlets as a “gaffe machine,” won 65 percent of the vote.
The Kremlin claimed victory on Monday, with Mr. Putin’s spokesman, Dmitri S. Peskov, calling the vote “very successful for United Russia.”
“In the country as a whole, the party has demonstrated its political leadership,” Mr. Peskov said.
Kremlin opponents dismissed those claims, noting that the United Russia brand is so toxic that all of the pro-Kremlin candidates in Moscow ran as independents. (Shortly after the vote, however, the independents announced that they would come back together under the banner of United Russia in order to maintain control of the City Council.)
Aleksei A. Navalny, Mr. Putin’s sharpest and most prominent critic, who has led a campaign to expose corruption among members of the Kremlin’s elite, also claimed victory.
“For the first time over the past 25 years of Putin in power, his party was met with an organized resistance at elections,” he said in a video statement.
While Mr. Navalny’s allies were not allowed to appear on the ballot, his organization ran a so-called smart voting campaign, sending participants text messages guiding their votes to the anti-Kremlin candidate believed to have the best chance of winning.
The exact effect of this method was difficult to gauge, but in some Moscow districts pro-government candidates experienced painful defeats.
Critics of Mr. Navalny’s method said that had he encouraged people to vote for candidates they would not support in a normal situation, and that all of the candidates who were allowed to run were pro-Kremlin, to some extent.
Grigorii V. Golosov, a political scientist at the European University at St. Petersburg, agreed that both Mr. Navalny and Mr. Putin’s Kremlin could legitimately claim victory. The difference is the cost of that victory, he said.
“The government has achieved its strategic goal of electing its governors in the first round, while Navalny proved that his strategic voting campaign can be effective,” Mr. Golosov said in a telephone interview.
“Still,” he added, “the campaign demonstrated that the government’s position is weakening, which is illustrated by how they had to remove basically all alternative candidates from the playing field.”