I felt something strange while watching Sunday’s Moscow mayoral election: excitement. It had real drama. Sergei Sobyanin’s margin diminished with every counted vote, hinting at the possibility of an unprecedented second round. Like everyone else, I was stunned at Alexei Navalny getting 27 percent of the vote. The election appeared so real it was surreal. Everything in Russia seemed so unpredictable . . . so alive. I too quickly jumped on the Navalny-giving-the-Kremlin-a-bloody-nose bandwagon. And then I thought otherwise.

The unpredictably, not to mention the meaning, of Moscow’s mayoral election depends on what you think the purpose was. If you think this election was about Navalny and his surprise showing, then he made the Kremlin shake in its boots. If you believe the poll was about re-electing Sobyanin, then sure he won, but he has little political capital to show for it. But this election wasn’t about Navalny, though he played an important role. It wasn’t even about re-electing Sobyanin, though that was a key goal. This election was really about the legitimacy of the Russian political system. Given Sunday’s results the plan seems to have worked.

What does legitimacy mean? No leader or ruling elite can rule by coercion alone. Even the most brutal dictator needs the consent of key constituencies to maintain the legitimacy to rule. The Putin system had unquestioned legitimacy for a decade. The politically active part of the population was lulled by prosperity. Everything, however, changed with the 2011-2012 protests. The system was shaken as an important sector, Moscow’s educated, cosmopolitan middle class, broke with Putin. They openly declared the Putin system a sham and its representatives as irrevocably corrupt.

Putin launched a two pronged solution to this problem. The first, and most visible, was a tightening of the political screws. The other was to enact a controlled opening of the political system. This was codified in two reforms in the final days Medvedev’s presidency: the easing of rules on party registration and returning elections to governors and the mayors of Moscow and St. Petersburg. Sunday was the first test of the electoral reforms. And indeed, more political parties participated and, in the case of Moscow and Ekaterinburg, opposition candidates made a strong showing. Most importantly, the status quo remained. United Russia or its affiliates retained political dominance. Everything went off without a hitch. Most of all, in the words of Putin, the vote was “legitimate and transparent” to boot.