Two years ago, a Russian friend told me that he thought that Alexei Navalny posed a serious danger to Vladimir Putin. I was sceptical. Russia had weathered the international condemnation and economic sanctions imposed after its annexation of Crimea in 2014. The country had just staged a successful World Cup. President Putin seemed well entrenched in the Kremlin.

But my friend was right. Through his bravery, determination and investigative flair, Mr Navalny has galvanised the Russian opposition. He has survived an attempt to kill him and returned to Russia to face arrest, imprisonment and, possibly, death. His example inspired mass protests across the country over the weekend. Whether Mr Navalny ultimately succeeds or fails, he now represents the most dangerous threat that Mr Putin has faced in the two decades since he took power.

There have been big anti-Putin demonstrations before. I was in Moscow in early 2012, as thousands took to the streets to protest against the Russian leader’s return to the presidency. I was there again, last summer, when there were further anti-Putin demonstrations provoked by the rigging of local elections.

But this time feels different. The current protests have taken place in more than 100 cities across Russia — from Vladivostok on the Pacific coast to Irkutsk in Siberia and Kazan in Tatarstan. Experienced observers say that the level of violence used against protesters is increasing: the police have swung their batons with more abandon, and some demonstrators have fought back. In 2012, the opposition did not have a clear leader. Now it does.

Mr Navalny and his organisation have stirred public anger with an extraordinary investigation into a palatial residence, apparently built for Mr Putin by the Black Sea. A film and illustrated essay, released to coincide with Mr Navalny’s return to Russia, highlight the extraordinary opulence of the palace. Computerised mock-ups, said to be based on leaks from disgruntled workmen, show a casino, pole-dancing room, amphitheatre and what looks like an underground ice-hockey rink. The place makes Donald Trump’s Mar-a-Lago look like a shack. The total area covered by the compound, which was filmed by an airborne drone, is claimed to be 39-times the size of Monaco.

Dmitry Peskov, the Kremlin’s spokesman, says that while the palace appears to exist, it does not belong to Mr Putin. Which raises the obvious question — who does own it?

The Kremlin still dismisses Mr Navalny as a figure of little significance, and until recently refused to utter his name in public. Mr Putin’s supporters point to opinion polls suggesting that Mr Navalny enjoys little public support, while Mr Putin remains relatively popular. But the regime is not prepared to test this proposition by allowing Mr Navalny to run in an election.

Mr Putin will be shaken, embarrassed and alarmed by the emergence of a younger, better-looking and braver opponent. But the Russian state’s apparatus of repression remains formidable. Previous opposition leaders have tended to end up in prison, in exile or dead — like Boris Nemtsov, who was killed near the Kremlin in 2015.

There seems little doubt that Mr Navalny will be jailed for several years. He may die in prison. Following his imprisonment on his return to Russia, Mr Navalny announced, via social media, that he has no intention of committing suicide. This was more than a dark joke. It was an attempt to shape the narrative before the authorities can announce that he has died by his own hand, or in a regrettable accident.

The probability is that there will be further and bigger demonstrations to come. Mr Putin and his support apparatus will hope that repeated arrests, sackings, beatings and killings will eventually wear down the opposition.

Whether the Russian leader’s carefully burnished image as the champion of ordinary citizens can survive such a process of mass repression is another question. As a keen student of the country’s history, Mr Putin will know that tsarist rule was shaken by repeated cycles of protest and repression before it was eventually toppled.

What happens next in Russia will be watched all over the world, particularly in China. Together, Mr Putin and President Xi Jinping have formed an axis of reaction — pushing back against pro-democracy movements around the world. The recent uprisings in Hong Kong and Belarus have seemed particularly threatening, because they took place so close to the power centres of Beijing and Moscow — and could serve to inspire Chinese or Russian opposition forces.

In Washington, President Joe Biden has now broken with his predecessor Donald Trump’s studied indifference to the fate of democracy and human rights in Russia. The Biden White House has urged the immediate release of Mr Navalny and his supporters.

The Kremlin will not listen. But US expressions of support for Mr Navalny and the protests will anger Mr Putin. One of the reasons that the Russian leader detested Hillary Clinton — and worked to defeat her — was the support that she expressed for anti-Putin demonstrators in 2012.

The Russian state’s machinery of repression is swinging into action. But beneath the tough exterior, the underlying fragility of President Putin’s regime is once again apparent.