Russia’s entry into the Syrian conflict has fundamentally changed the dynamic of the four-and-a-half-year-old war there. With a bombing campaign that now includes launching cruise missiles into Syria from Russian warships in the Caspian Sea, the Kremlin is gambling that it can preserve the weakened Assad regime. The move brings Russia into a costly and intractable civil war, raises the threat of terrorism by Islamist groups in Russia, and puts Russian forces in direct confrontation with the US-led coalition that is arming moderate Syrian rebels and fighting ISIS.

So the question arises: Why is Russia doing this now? According to a high-level source in the Kremlin, the decision to intervene in Syria was urged on Putin this summer by three senior members of his team: Sergei Ivanov, head of the Russian Presidential Administration, Minister of Defense Sergei Shoigu and Nikolai Patrushev, former head of the FSB and now the leader of the Russian Security Council. Assad’s regime was increasingly in danger, facing not only ISIS, but al-Nusra, and holding, by some estimates, less than 17 percent of Syria’s territory. Even members of Syria’s Alawite minority, to which the Assad family belongs and which are a crucial base of his support, had begun fleeing the country. With the conflict in Ukraine still unresolved and Putin increasingly isolated by the West, intervention in the Middle East was intended to reassert Russia as a major world power and act as a counterforce to Western support for the Ukrainian government in Ukraine.

It was no surprise that the principal targets of Russian bombing raids in Syria have not been ISIS, but rather other rebel groups that the US and its Western allies support. (Though Russian cruise missiles have now also been directed as ISIS targets.) Putin, in his appearance at the UN in late September, stated unequivocally that Russia was committed to keeping the Assad regime in power, and from the Kremlin’s point of view, this makes sense. Russia fears the total collapse of the Syrian state, which would end a decades-old alliance and threaten its strategic position in the Middle East. And it views Islamic insurgents as not only a threat to Assad, but also a potential threat at home.

It is important to note that Russia has a long history with Syria, dating back to the immediate post-World War II period. The Soviet Union signed a secret pact with Syria in 1946, promising political and military support to Syria’s national army, followed four years later by a non-aggression treaty. The 1955 Baghdad Pact, an agreement among Britain, Iran, Iraq, Turkey, and Pakistan to prevent Soviet expansion in the Middle East, led to further rapprochement between Syria and the Soviet Union. The alliance was strengthened during the Suez crisis of 1956, which brought the two countries together in backing Egypt.

Syria, at this time, had the largest Communist Party in the Arab world and significant oil and gas reserves, which offered the Soviets an opportunity to provide technological support to its energy ventures. The geo-strategic position of Syria became even more important to the Soviets in 1971, when they leased a naval base at Tartus, on Syria’s Mediterranean coast. Tartus hosts the fleet of ten Russian warships and auxiliary vessels in the area. Given that Russia’s Mediterranean fleet is so distant from home, this base is crucial to Russian military interests.

This is not to mention the income Russia has received from selling arms to Syria. Russia has been Syria’s major arms supplier for decades, accounting now for over three quarters of Syria’s arms purchases, including in August, a package of YAK-130 attack jets and MiG-29 fighters. Since Damascus is now essentially bankrupt, Moscow has had to write off much of the debt from the Soviet era, but that has not stopped the continuation of arms contracts with Russian firms.

All of which has provided a strong incentive for Russia to prevent the collapse of the Assad regime. Kremlin decision-making is always an enigma, but the comments of Dmitry Rogozin, deputy Russian prime minister in charge of the defense industry and one of the architects of the Crimean invasion, who is on the EU sanctions list, suggest that Putin’s close advisors are in unison on Syria. Rogozin directs an economic cooperation committee between Russia and Syria established this year by Putin. After Russia began bombing in Syria last week, he posted this on Facebook: “Our guys in Syria are suppressing a war against Russia on distant plains. Anyone who does not understand is a fool or an enemy.” This is as clear a statement yet of Russian motivations, however irrational and short-sighted they may seem to the West.

A more important question is how Russia’s new military involvement in Syria will play out with the Russian population. The chairman of the Russian State Duma Committee for International Affairs, Alexei Pushkov, has said that Russia’s air campaign in Syria would continue for two to three months, but he could not exclude the possibility that it would last longer. Meanwhile, Russia has said it plans to send ground troops, claiming of course that they are “volunteers,” as it has done with Ukraine. As yet, there is no confirmation of any major deployment in Syria. But if the Kremlin does carry out such a plan, what happens when body bags start to arrive home? 75 percent of over 50,000 responders to a recent poll by the independent radio station Ekho Moskvy were against Russia deploying ground forces in Syria. This audience represents a select group that reaches beyond state-controlled television for its news, but a poll by the authoritative Levada Center in Moscow showed that 69 percent of respondents opposed Russia introducing troops to support Assad. Russian journalist Gamid Gamidov, predicting that Russia will be mired in the Syrian conflict for a long time, observed that “a war on foreign territory, at a time of deepening financial crisis, means increasing the likelihood of more dissatisfaction…on the side of [Russia’s] population. The idea that ‘we have nothing to eat here and they are throwing all the money on a war in Syria’ will gain momentum and discontent with the [Kremlin] regime could bring it to an end.”

Putin has justified the Russian incursion in Syria as a fight against global terrorism, warning that Russian militants fighting against Assad could come back home and carry out terrorist attacks. But it seems far more likely that Russia’s own involvement in Syria will encourage, rather than contain, such threats. Russia has a population of over 15 million Muslims, most of them Sunnis. And there are millions more in the neighboring republics of the former Soviet Union. While Russia has a history of militant and terrorist attacks, until now, there have not been incidents tied to ISIS or the war in Syria. However, the Kremlin’s attacks on Sunni strongholds in Syria could well produce a backlash and radicalize these Muslim populations, particularly in the North Caucasus.

Putin may hope that Russians will come to view the Kremlin’s Syrian venture as they have its involvement in Ukraine. In contrast to Syria, the Ukraine intervention continues to have broad public support. A Levada poll in June revealed that a majority of Russians backed the annexation of Crimea and saw the war in Ukraine as a result of the US and its allies’ efforts to undermine Russia. According to Russian sociologist Denis Volkov, “Russian television’s portrayal of Ukraine as a failed and disintegrating state overrun by nationalist forces has mostly had the desired effect.”

While the Western press has been preoccupied with Syria, Russia has continued its activities in Ukraine. In early October, Putin had talks with the leaders of Ukraine, France, and Germany in Paris, the first meeting since a peace deal was signed in Minsk in February. Russia agreed to persuade Ukrainian separatists in Eastern Ukraine to postpone their plans to hold their own elections this month, which Kiev and its Western allies have opposed. But a disturbing report by the OSCE (Organization for Security and Cooperation in Europe) last week about a new and highly destructive Russian weapons system—the so-called Buratino multiple rocket launcher—appearing in Eastern Ukraine raises doubt about Russian intentions.

A larger question, however, is whether the serious decline in the Russian economy could erode support for these military ventures. The plunge in oil prices, together with Western economic sanctions, have caused real incomes in Russia to fall significantly, with inflation reaching more than 15 percent. According to the independent Russian newspaper Novaya gazeta, Russian expenditures on the Syrian military effort are so far within the bounds of the country’s budget, and much less than the estimated $9.9 million a day that the US and its allies are spending there in bombing attacks. The Russians are using airplanes and ammunition that have long been paid for. But the price will rise significantly if Russia introduces ground troops into Syria or its bases are attacked by militants. According to Russian military analyst Pavel Felgenhauer, “Serious spending will begin when losses have to be replenished—damaged ammunition, motor vehicles and maybe aircraft.” All this will add to Russia’s budget deficit, which is projected to be 3 percent this year and next. It may be only a matter of time until Russians begin questioning Russia’s involvement in Ukraine along with Syria.

The Kremlin’s involvement in Ukraine and Syria seems to be motivated partly by its aversion to democratic regimes, in particular the so-called color revolutions that have sprung up in the Middle East and in Georgia and Ukraine. The Arab Spring came only half-heartedly to Syria, with the democratic uprising soon overtaken by armed conflict. But this does not rule out, from the Kremlin’s point of view, the possibility of insurgent groups unfriendly to Russia eventually taking over the country. The breakup of Syria, or the replacement of the Assad regime by a government more aligned with the Sunni Arab world, would leave Russia without a client state in the Middle East.

As for Ukraine, it is dangerously close both to Russia and to countries belonging to the European Union and NATO. At the UN in late September, Putin mentioned how difficult it has been for Russia, after the fall of the Soviet Union, to contend with the expansion of NATO to countries along its border. This may explain why Russia has been increasingly aggressive in violating NATO airspace in the Baltics, just as it has recently violated the airspace of Turkey, a NATO member.

In both the Ukrainian and Syrian conflicts, the Kremlin is trying to provide a counterweight to NATO. Yet while Russia has managed thus far to hold its own in Ukraine, the Syrian gambit is far riskier. In the words of the prominent Russian journalist Yulia Latynina: “The Islamists, including ISIL, are operating in this war with much longer experience and more successfully than the Kremlin…The scandals over Guantanamo and Abu Ghraib will seem like kindergarten in comparison to what in a month the western media will be saying about Russian involvement in Syria.”