Vladimir Putin is all but certain to return to Russia's presidency with the same swagger, bravado and fighting talk against the West as when he entered the Kremlin 12 years ago.
But the country he will get the chance to lead for another six years after an election on Sunday has changed, and he is on a collision course with Western powers and a newly confident middle class demanding a freer and fairer Russia.
"The way he is conducting the campaign at the moment sends a signal reading 'I am sure of myself, I am the strongest of them all, I control everything, I am the leader, nothing has changed.' But this is not true," said Maria Lipman, a political analyst at the Moscow Carnegie Centre think tank.
A few months ago, the former KGB spy was a safe bet to win two more terms and rule until 2024, keeping him in power almost as long of Soviet dictator Josef Stalin.
All that changed when he bungled the announcement of his presidential bid on September 24 and allegations of fraud in a parliamentary poll on December 4 soured the mood, triggering the biggest opposition protests since he rose to power.
He may now struggle to see out even one full term.
Writing off the 59-year-old prime minister before he has even returned to the post he held from 2000 until 2008 would be reckless: Putin is a survivor and a pragmatist.
He still tops opinion polls as Russia's most popular politician, controls most media, has strong ties in business and the security forces, and many Russians credit him with overseeing an economic boom and making the country strong again.
Opinion polls suggest Putin will comfortably pass the 50 percent of votes needed for victory without a runoff. Political experts say he will reclaim the presidency regardless of whether the vote is clean and whatever the turnout.
Even foreign diplomats in Moscow see Putin as a safer option than the other candidates - billionaire Mikhail Prokhorov, Communist Gennady Zyuganov, nationalist Vladimir Zhirinovsky and former upper house speaker Sergei Mironov.
But one senior Western envoy said: "Six months ago diplomats talked about what Putin will do in 12 years' time. Now they talk about whether he will last for six years."
OUT OF TOUCH
The man once described in U.S. diplomatic cables as Russia's alpha dog looks more out of touch than at any time in his career. Tough-guy antics, such as shooting a tiger with a tranquilizer and horse-riding with a bare torso, are no longer guaranteed to impress voters and are openly mocked by some.
When he said on national television in December that he had mistaken the white ribbons worn by opposition protesters for condoms, a fake picture of him wearing a condom pinned to his chest went viral on the Internet within minutes.
"We will have a weak authoritarian national leader," said opinion pollster Lev Gudkov, describing what he saw as a "crisis of confidence" in the authorities.
When Putin was elected president in 2000, Russians craved a strong leader after the anarchy of Boris Yeltsin's presidency.
Now, he faces ever more frequent protests led by Russia's urban middle class who want to live in a modern country with independent courts and no corruption.
As one source close to the Kremlin put it, Putin has been slow to grasp the seriousness of the situation, certainly slower than his younger ally, Dmitry Medvedev, the iPad-carrying president with whom he is about to swap jobs.
"He is at a fork in the road and this situation is not entirely clear to him," said Igor Mintusov, a political consultant involved in several Russian election campaigns.
"Everything was clear to him at the beginning of the 2000s - to preserve Russia, to raise its ambitions and from this came liberal reforms. Now this clarity does not exist."
MAN OF ACTION
Vladimir Vladimirovich Putin's domination of Russia began on December 31, 1999, when Yeltsin quit and asked him, as prime minister since August, to stand in until an election.
Putin quickly headed to Chechnya to visit federal troops he had sent to fight Islamist separatists in the southern region. The message was clear: Putin was a man of action determined to restore Russia's dignity, stability and global standing.
He wanted a clean break with an era marred by Yeltsin's erratic behavior, reports of drinking and ill health, as well as endemic corruption and lawlessness.
Russia had defaulted on its debt in 1998 but after Putin came to power, it recorded nine successive years of growth.
His popularity rose as a surge in the price of oil, Russia's main export, fuelled prosperity. Elected president in March 2000, he won a new term in 2004.
"One hundred years ago the sovereign said that Russia had just two allies, the army and the navy," Deputy Prime Minister Dmitry Rogozin said, referring to Tsar Alexander III.
"But in the time since, Russia has increased its allies, doubled them in fact. Today Russia has four allies: The army, the navy, the military-industrial complex and Vladimir Putin."
Putin reined in Russia's restive regions and clipped the wings of tycoons known as oligarchs who gained political power and huge fortunes after the Soviet Union collapsed in 1991.
Marina Kuzmina, 46, spoke for many when she defended Putin at a rally last week attended by tens of thousands.
"I came here for stability, for there not to be any revolutions in the future. Personally, my quality of life has really improved," she said.
But when Putin addressed the rally, evoking the defeat of Napoleon Bonaparte in 1812 in an appeal to national pride, some of those present said it sounded like he had said it all before and that he, and his vision of Russia, were stuck in the past.
When he took over, Putin vowed to protect freedoms of speech, conscience and the media as "fundamental elements of a civilized society".
Instead, he cracked down on the media and smothered criticism. Murders of investigative journalists have rarely been solved and political opponents were long silenced.
Mikhail Khodorkovsky, an oil tycoon with political ambitions, was arrested in 2003 and then jailed on fraud and tax evasion charges.
The organizers of the anti-Putin rallies attended by tens of thousands of people have lost faith in him ever changing.
"This means the same conflict between him and civil society will continue," said Vladimir Ryzhkov, an opposition leader.
Protests are planned in Moscow the day after the election.
"How much can we take?" asked Sergei Shikov, a 40-year-old driving instructor. "We have so much corruption among state employees, police and even plumbers. Putin and his circle sit at the top of it all ... He and his friends are getting richer."
WARNINGS ON UNREST
Putin has allowed the peaceful protests so far, but has indicated that his patience may be running out. He warned this week that opposition figures may try to stoke unrest, a refrain taken up by supporters to underline that the protesters are a minority of Russia's 143 million population.
"I don't think there are really many people who want to push Russia into catastrophic chaos," said Oscar-winning film director Nikita Mikhalkov.
Putin could also face confrontation with the West after whipping up anti-American hysteria during his election campaign, accusing foreign governments of financing the protests.
Moscow has already locked horns with the West over the bloodshed in Syria and with Washington over U.S. plans to site a missile-defense shield in eastern Europe.
Putin may ease this rhetoric once he is back in the Kremlin, but diplomats say he is unlikely to quickly change policies that he has shaped even as prime minister.
Putin hopes his election will end the uncertainty that has put off foreign investors and led to $84 billion in capital flowing out of the country last year.
But investors are seeking a commitment to reforms such as cutting corruption, privatization, restructuring large state companies and a reduction in dependence on energy exports.
Spending promises by Putin during the campaign could return to haunt him as tax rises may be needed to fill state coffers.
LOSING HIS GRIP?
Until September, Putin's grip on Russia seemed firm.
He had risen quickly after working in the city authorities of his home town, St Petersburg, on his return from service with the KGB in then East Germany after the Berlin Wall fell in 1990.
"He had incredible charm which affected men and women, especially women. He could talk a woman into anything," said Lyudmila Fomicheva, press secretary to Putin's former boss, St Petersburg Mayor Anatoly Sobchak.
Putin held a senior Kremlin post from 1996 before being appointed head of the FSB security service and then premier.
His popularity remained high, even when he stepped aside to become premier in 2008 because of constitutional limits and ushered Medvedev into the Kremlin , but his relations with West have long been prickly.
This is perhaps not surprising, given his own remark: "There is no such thing as a former intelligence officer." Former U.S. Secretary of State Colin Powell said that when he looked into Putin's eyes, he saw KGB.
But Putin's touch deserted him with the announcement on September 24 that he and Medvedev would swap positions this year.
"There were a lot of nice ways for Putin to return but this arrogant, undemocratic job swap alienated so many people, even their own followers, that his ratings started to fall," said Ilya Ponomaryov, one of the protest organizers.
Putin's standing slid further among urban middle-class voters when allegations of fraud emerged after the December 4 election won by his United Russia party.
Initially Putin sought to mock and insult the protesters who took to the streets. He has since held out an olive branch but has not met the protesters or granted any of their key demands.
HOLDING ON TO POWER
To hold on to power, Putin will need to keep the support of the influential political, security and business elites.
There have been no overt signs that he has been abandoned by any of those constituencies although conflicting signals towards the media - glimpses of a more liberal approach accompanied by a backlash against outlets that criticize him - could point to differences of opinion behind the scenes.
Some political analysts say he will have to make concessions to the protesters - perhaps allowing Medvedev only a short time as prime minister before replacing him with a liberal such as Alexei Kudrin, a former finance minister respected by the West.
Another possible concession would be to call an early parliamentary election. This could pave the way for a parliament that offers real opposition for the first time in years as United Russia recedes or becomes defunct.
If he goes too far, too quickly, Putin risks alienating conservatives happy with the status quo.
"He's going to move very gradually towards a more liberalized society but he has to watch his back because some of his people want a crackdown," said Vladimir Pozner, a veteran television journalist and commentator.
"I am not foreseeing 12 more years of Putin anyway. I am seeing a maximum six, but perhaps not even that."
If that happens, Putin may want to groom a successor to grant him immunity from prosecution, just as he did for Yeltsin in one of the first moves of his acting presidency 12 years ago.