RUSSIA'S elections are not intended to produce surprises, just as its streets are not meant to heave with protesters and its political leaders are not supposed to be publicly booed. The country's “managed democracy”, with the media muzzled, only tame opposition candidates allowed and widespread vote-rigging, is designed to hand big victories to Vladimir Putin and his United Russia party. Yet the Duma election on December 4th produced an upset: United Russia's share of the vote fell from 64% to under 50%, giving it only a slim majority. Even more remarkably, demonstrators took to the streets in the biggest protests Russia has seen in years, chanting “Russia without Putin” before troops poured in to stop them (see article). Smaller protests took place in other cities. Now some 17,000 people have signed up for a protest on December 10th in Revolutionary Square, Moscow's main public space. The government has asked them to find a different location.

These events constitute the biggest crack in Russia's regime since Mr Putin first came to power in late 1999. That they are happening just as he prepares to return next March for at least another six years as president is no coincidence.

Mr Putin's power has rested on two foundations. One is that, despite his government's contempt for human rights and his tolerance of the kleptocracy around him, Mr Putin had legitimacy because he was personally extremely popular. The other is that, thanks largely to ever higher oil prices, he was able to ensure steadily rising living standards for Russians. Both foundations now look fragile. That does not portend an imminent end for Putinism; but for the first time, the prospect of a post-Putin Russia no longer seems fantastical. That should be a wake-up call for Russia's leader to embrace reform.

The popularity stakes

Mr Putin starts with certain strengths. His people are hardly yearning for liberalism: in a recent poll by the Pew Foundation, Russians, by a margin of 57% to 32%, preferred to rely on strong leadership rather than democracy to deliver good government. And by the standards of leaders elsewhere, Mr Putin still seems pretty popular, with approval ratings of around 40%. Nothing is likely to stop him winning the presidency in March.

But opinion is clearly moving against him. Mr Putin, who is now prime minister, saw his popularity start to fall the moment in September when he announced his plan to swap jobs with Dmitry Medvedev, the puppet he installed as president after his first two terms ended in 2008. Soon afterwards Mr Putin was booed at a martial-arts contest—a staggering idea only a few months ago. He cancelled further public appearances, but the substitutes he sent were booed in his stead. This may not be a “Ceausescu moment”, when a coddled dictator wakes up to popular fury. But it is still a big shock.

A bigger problem for Mr Putin is that the demands of the economy and of his political operation are increasingly in conflict. In order to hold on to power, he has kept a tight grip on the economy. As a result both Russia and the regime's patronage system remain heavily dependent on oil and gas. Corruption and inefficiency mean that the budget will not balance unless oil prices stay around $110 a barrel—which, given the grim global outlook, they are not likely to. Capital and talent are fleeing an economy that offers few opportunities. Growth rates are likely to come down. Without rising living standards, resentment against the government is likely to swell.

Twenty years ago, a similar contradiction between politics and economics brought down the Soviet Union (see article). Weirdly, Mr Putin seems to welcome comparison with this period. He touts as his new foreign-policy priority a “Eurasian Union” of former Soviet republics, and he lets his supporters praise the Brezhnev years—another period in which stability turned to stagnation. Yet he must fear the possibility that resistance to his regime, too, will grow. Can he avoid it?

Mr Putin presents himself, first and foremost, as a strong-minded patriot. If he has his country's interests at heart, he will respond to rising discontent by opening up the economy and curbing corruption. The criminal-justice system has become a tool of the Kremlin and its commercial allies. Russians of all sorts loathe such cronyism. Both Mr Putin and Mr Medvedev have talked about tackling graft, but done nothing. If they took action, they would lose some power, but win kudos.

The alternative is more repression. The decision to call in the troops suggests this is Mr Putin's chosen route. He may entrench his hold in other ways—perhaps by distancing himself from United Russia, widely derided as “the party of crooks and thieves”, or by dumping Mr Medvedev as prime minister. Seasoned observers also expect imagined threats to the state, to which the government reacts by cracking down. For a model, Mr Putin needs only to look next door to Belarus, where Alyaksandr Lukashenka clings on as Europe's last dictator.

Such an approach may work, for a while. His regime has a tight enough grip on the security services to suppress dissent for some time. Yet as the old Soviet Union found (and today's Belarus is finding), economic problems make repression harder to sustain. With the internet watching, it is also difficult to keep engineering large-scale voting fraud. There is a growing risk of a social and political explosion in Russia, even if it is too early and the opposition is too disjointed for there to be much hope of a Russian spring.

Don't bet on a falling tsar

The idea has taken hold abroad that Mr Putin's regime, though mildly distasteful, provides stability. That has proved wrong. As many Western companies have found, Mr Putin has failed to build the rules-based system that provides the economic security foreign investors need. Nor, as recent events suggest, has he delivered a political equilibrium. It is not just this week's protests that are a reason for concern: rising lawlessness in the north Caucasus may cause problems not just for Russia, but for the entire region.

Russia is not stable. It is rigid. Unless its tsar moves to reform his realm, it will become more dangerous—both for its neighbours and for Mr Putin himself.