Over the course of a month I spent in the Russian capital, the red-and-black billboards of Yevgeny V. Prigozhin’s Wagner paramilitary group multiplied. “Join the team of victors!” they said, beneath an image of menacing mercenaries in balaclavas and masks, only their eyes visible.

A possible implication was that the Russian forces on the other mushrooming Moscow billboards — regular soldiers recruited by the Ministry of Defense pictured above slogans like “Real Work!” or “Be a hero!” — were the losers of President Vladimir V. Putin’s reckless gamble in Ukraine.

As heedless Muscovites headed for their offices and gyms, their Italian or Japanese restaurants, their bars and nightclubs, this military recruitment drive on two fronts offered the sole image in the capital of the Russian scramble to contain the fallout, and hide the full impact, of the invasion that began 16 months ago. Easier to order a latte than dwell on lost lives in Mariupol.

Now, with his blunt depiction of that invasion as a “racket” that “wasn’t needed to demilitarize or denazify Ukraine,” and his apparently short-lived armed uprising, Mr. Prigozhin has played on one of Mr. Putin’s worst fears: division and rebellion, with tanks on the streets, as in the mayhem of the 1990s from which Mr. Putin, a former K.G.B. officer, abruptly emerged as the inscrutable president and Mr. Stability.

Since then, over 23 years, Mr. Putin has steadily consolidated his power, using his wars that began in Chechnya to cement nationalist sentiment, terrorizing the opposition to the point that dissent has become a crime, and shaping a wildly unequal economy around a coterie of handpicked oligarchs. He has reverted Russia to type as an autocratic police state under an all-powerful latter-day czar after its brief but heady post-Communist flirtation with a freer society.

“The system Putin built is very stable,” a Western ambassador in Moscow told me this month. “But if I woke up one morning and saw tanks on the street, I would not be totally astonished.”

This surprising disclosure, uttered under customary diplomatic anonymity, is indicative of the close-knit secrecy of Mr. Putin’s inner circle that has made Kremlinology during the war in Ukraine as arduous as at the height of the Cold War. There are very few tea leaves to read. Russia, smothered in propaganda and fear, is opaque.

At the same time, even as the government has gone to great lengths, and expense, to maintain an illusion of business as usual, the placid surface Russia has until now presented during the war masks unease.

In muttered expressions across the country of bewilderment and anger, and not least in Mr. Prigozhin’s foul-mouthed diatribes against what he sees as the craven incompetence and half-measures of Russia’s generals, lay the seeds of those tanks in the ambassador’s prescient imaginings.

Russia tends not to evolve; it lurches, as in 1917 or 1991, and it circles about. Mr. Putin has perpetuated old habits in deploying doublethink. He prefers to “forget whatever it was necessary to forget,” and then restore “memory again at the moment when it was needed,” as Orwell put it.

Hence Mr. Putin’s invocation of 1917 in his brief speech on Saturday, a time when internal fracture led to the nascent Soviet republic losing significant population and vast swaths of agricultural land in the Treaty of Brest-Litovsk the next year. Therefore, Mr. Putin vowed, he would resist the current “deadly threat” of “mutiny” through “brutal” actions.

Suddenly the glorious Soviet victory over Nazis and Fascists of “The Great Patriotic War” of 1941 to 1945, which has been the drumbeat of the quixotic Ukrainian assault, was set aside by Mr. Putin in favor of a crushing historical defeat.

He wields the past to his ends, even as he has very little to say about the future.

Nobody, for example, knows what Mr. Putin would define as victory in his “special military operation” in Ukraine. Other mysteries abound. The question, for many months now, has been how Mr. Prigozhin, a former convict who started in hot dogs in St. Petersburg and went on to provide catering for the Kremlin, has survived.

If the family of a Russian child drawing a picture of a Ukrainian flag risks prison in Mr. Putin’s Russia, how could this loudmouth in battle fatigues get away with suggesting that Sergei K. Shoigu, the defense minister, has enabled genocide, among a torrent of other accusations and insults?

I heard many answers across Russia. But perhaps the most fundamental lay in the recently dug grave of Boris Batsev, aged 42, a railroad worker who was killed six months ago near Bakhmut in eastern Ukraine, leaving a wife and two children.

Brightly colored plastic roses and carnations were piled high around his gravestone, beneath the red-and-gold Wagner flag, in Siberia, near the town of Talofka, thousands of miles from the Ukrainian front.

“Blood, honor, motherland, bravery,” a Wagner inscription said. A mild breeze blew across the Troetskoe cemetery as agents of the Federal Security Service, or F.S.B., looked on from a vehicle that had abruptly appeared nearby.

With Russian forces often bereft of essential equipment and sometimes operating as a human wave, Mr. Putin has needed flesh for the meat grinder. Mr. Prigozhin, recruiting in Russian prisons with offers of amnesty and big payouts, could provide that, from as far away as Siberia. He has been too effective and useful to toss aside.

In the long battle for the charred ruins of the eastern Ukrainian city of Bakhmut alone, Mr. Prigozhin has said Wagner lost 20,000 troops.

The use of Mr. Prigozhin, others suggested, was the apotheosis of Putin’s modus operandi of dividing his subordinates, shifting influence in recent years from Sergey V. Lavrov, the foreign minister, to Mr. Shoigu as the militarization of Russian society proceeded, only to undermine the defense minister through Mr. Prigozhin.

“Putin likes competition, he has liked putting pressure on Shoigu, and enjoyed the theater,” Dmitri A. Muratov, the Nobel-prize-winning editor of the shuttered independent newspaper Novaya Gazeta, told me in an interview. “Meanwhile, the elite around Putin don’t give a damn for their country, they’re just afraid for their lives.”

Mr. Prigozhin has been useful in other ways for Mr. Putin. Through Wagner, he has helped project a ruthless and lawless form of Russian power across several African countries, including Mali and the Central African Republic. He was also a way, in the midst of an utterly misjudged war, for the Russian leader to play the moderate, to suggest that if it was not for him, things could be even worse and become as unstable as Mr. Prigozhin’s temper.

Finally, Mr. Prigozhin became an increasingly popular mouthpiece for the widespread resentment of moneyed Russian elites, oblivious to the cost and suffering of the war in Ukraine. This was cathartic, given accumulated Russian frustrations, and perhaps useful to Mr. Putin in that sense.

But the paramilitary leader also developed, through adept use of social media and compelling rhetoric over the past nine months, into a true national figure, with a notoriety that has made him the object of much debate and speculation about a possible political future.

Mr. Putin has now awakened to this danger, even as Mr. Prigozhin may have overplayed his hand.

The Russian president has spoken of an “armed rebellion,” and a former commander of Russian troops in Ukraine has spoken of a “military coup,” but Mr. Prigozhin’s description of his actions as a “march for justice” will have resonated with some, perhaps many, Russians.

These sentiments will not disappear overnight, even if, according to Dmitri S. Peskov, the Kremlin spokesman, Mr. Prigozhin has now ceased moving military convoys toward Moscow and agreed to go to Belarus in exchange for charges being dropped again him and his fighters.

To what degree the whole back-and-forth was orchestrated theater, and to what degree a genuine confrontation, seems unlikely to be clarified soon, if ever.

What is clear is that Mr. Putin has deep reserves of support. “The West told Russia that all it has the right to do is yield,” Petr Tolstoy, the deputy chairman of the Duma, the lower house of the Federal Assembly of Russia, said in an interview. “Putin said ‘Enough!’ and that ensures him of popular backing.”

The president’s control of the country’s military, security and intelligence apparatus is such that the biggest direct challenge to his rule in more than two decades appears to have been repulsed in short order, even if Mr. Putin has suffered the acute embarrassment of allowing a man he called a traitor to get off scot free the day he made that accusation.

It had been a long time since Mr. Putin blinked in this way.

There will be reverberations. Very little since the Ukraine invasion on Feb. 24 of last year has gone according to plan for Mr. Putin. Hiding a war that has taken 100,000 Russian lives, according to American diplomats in Moscow, has a cost. The exercise of not leveling with the Russian people contributed to Mr. Prigozhin’s fury, as was made clear in his repeated statements that the defense establishment was lying.

Mr. Prigozhin has styled himself as the man who delivers the hard truth. In the Belgorod region on Russia’s border with Ukraine, which I visited earlier this month, he was infuriated that Mr. Putin and his state media would prefer to forget the devastation through cross-border Ukrainian shelling of Shebekino, a Russian town of 40,000 people.

In the city of Belgorod, in a vast improvised dormitory for the displaced at an indoor cycle track, I met Aleksandr Petrianko, 62, half-paralyzed by a stroke.

“Could Mr. Prigozhin have saved Shebekino?” I asked him.

“I don’t know,” he said in a trembling voice. “I hope he is not killed before his time.”