IF HIS intent was to draw attention to his military muscle, he certainly succeeded. Vladimir Putin, Russia’s president, became the first leader in the Kremlin since Leonid Brezhnev, who invaded Afghanistan in 1979, to send military aircraft on bombing missions outside the territory of the former Soviet Union. On September 30th, Russian jets began a targeted campaign in parts of Syria held by rebels in order to prop up the beleaguered regime of Bashar al-Assad, a Russian client.

Not since the Boxer rebellion in 1900 have Russian forces fought in such proximity to American ones. In Kosovo they came close. In Syria they share the same skies: America is attacking the jihadists of Islamic State (IS); Russia says it wants to strike IS but has in fact started by attacking other Sunni rebels (including some who have received American weapons) who pose a more direct threat to Mr Assad.

Mr Putin has ruled out the use of ground forces in Syria, for fear of awakening painful memories of the Soviet debacle in Afghanistan. But by deploying jets and air-defence systems, Russia is complicating Western operations in Syria. France this month joined America in the increasingly crowded skies of the Levant.

Russia has prepared its air campaign for some time. Two weeks ago it held elaborate domestic war games in terrain closely resembling the Syrian desert. Russian war reporters who spent months on the eastern Ukrainian front lines have suddenly appeared in Syria, cameras rolling at the site of terrorist attacks.

The Russian Orthodox church has spoken of a holy war. But for the Kremlin it is just as important to be seen to be confronting America, which Mr Putin accuses of trying to dominate the world. Dmitry Kiselev, Russia’s chief television propagandist, put it with wilful inaccuracy: “In Syria, America stands on the side of the terrorist caliphate. Together they are trying to destroy Syria as a secular state.”

Spade-work

Russia’s bombing in Syria was preceded by a flurry of diplomatic activity. On September 28th Mr Putin spoke at the United Nations General Assembly in New York, comparing Russia’s role to that of the Soviet Union in 1945 and blaming America for unsettling the Middle East. “I am urged to ask those who created this situation: ‘Do you at least realise now what you’ve done?’ But I’m afraid that this question will remain unanswered, because they have never abandoned their policy, which is based on arrogance, exceptionalism and impunity,” Mr Putin declared from the podium.

Russian media portrayed him as a superman who has to clean up a mess. Ria Novosti, the state news agency, and other government propagandists flooded social-media networks with messages bearing the hashtag “#PutinPeacemaker”.

The president has received some verbal support for his new campaign from the Italian prime minister and the German foreign minister, among others. But in America he is still viewed as a villain. A meeting with Barack Obama—the first long one since Russia’s annexation of Crimea—ended with no result. Trust between the two leaders is the lowest it has been in decades, say close observers.

Mr Putin may be hoping that by claiming to fight IS he can force America into accepting him again as a partner in power, one too important to be isolated by sanctions imposed by the West in response to the war in Ukraine. Yet his gambit is laden with risks. Russia could get bogged down in what may be an unwinnable conflict. Its relationship with America could get worse rather than better, especially if the two military forces clashed, even inadvertently. Russian pilots might, given the lack of co-ordination in the skies, fall into the hands of knife-wielding executioners. “Putin miscalculated in Ukraine and he may miscalculate in Syria,” warns Dmitry Trenin, the head of the Moscow Carnegie Centre, a think-tank. So why take such risks?

Russia’s official—and not entirely unreasonable—response is that IS poses a threat to its national security, particularly in the north Caucasus, where many young fighters in Syria come from. The timing of the deployment was also partly prompted by the fact that Mr Assad’s forces have been losing ground. While the Kremlin cares little about his personal fate, it needs him, or another ally, to stay in power long enough for Russia to have a say in any international negotiation on the future of Syria. There is also Russia’s naval base in Tartus on the Syrian coast, its only foothold in the Middle East, which is a big market for Russian-made arms.

Even more important for Mr Putin is his hold on power at home, and here too Syria may be of use. The bombing provides a new and badly needed spectacle at a time when the war in Ukraine, which dominated the airwaves for a while, is starting to freeze and euphoria over the annexation of Crimea is fading. On top of that the Russian economy, hit by sanctions and falling oil prices, has been shrinking fast. During his first two presidential terms Mr Putin could boast about growing incomes. In his third term, he seems to rely more on the theatre of war and a manufactured sense of pride in challenging America.

“Syria provides a useful distraction from Ukraine, but strategically it is about America,” says Mr Trenin. So far Mr Putin has avoided a direct clash with his great rival, but he has trapped Russia in a dangerous spiral of confrontation. As Georgy Mirsky, a venerable Middle East expert at Moscow’s Higher School of Economics, says: “The rules of the confrontation dictate that you find your opponent’s weak spot and hit, hit, hit.”