In Syria, some of Europe’s leading powers find themselves allied with Vladimir Putin in the military campaign against ISIS; in Ukraine, the Europeans have combined forces with the Americans to contain the Russian president’s imperialistic advances.

The tangled alliances are bewildering, but the situation is more complex still. In the case of Syria, Western critics claim that Russia’s air force is actually concentrating less on bombing Islamic State strongholds than on targeting insurgent groups, some of which are backed by the West, that are trying to topple Moscow’s ally, Syrian President Bashar al-Assad. (The Kremlin’s fight against ISIS may have acquired renewed urgency after the jihadist group brought down a Russian airliner over Egypt in October.)

In the case of Ukraine, it’s true that the European Union has joined the United States in imposing severe economic sanctions on Russia in retaliation for the Kremlin’s belligerent behavior toward its neighbor after the 2014 Ukrainian revolution. Putin’s annexation of Crimea, destabilization of eastern Ukraine, and threats to Baltic countries achieved what decades of high-level summits and hortatory speeches had failed to accomplish: a united Europe capable of making difficult foreign-policy decisions—and enforcing them in a disciplined fashion. Slapping sanctions on Russia is costly for Europe. Exports to Russia make a critical difference to many European companies that since 2008 have seen their sales plummet as a result of the eurozone’s prolonged economic crisis. Moreover, several European countries are quite dependent on Russia’s oil and especially gas exports. The elimination of the current sanctions regime theoretically depends on a permanent ceasefire between the pro-European Ukrainian government and Kremlin-backed separatist rebels in eastern Ukraine. Yet while many European leaders have expressed intentions to prolong the sanctions, which are set to expire in January, the will in the region to sustain them appears to be ebbing.

This weakened resolve is the product of many factors, including Putin’s recent actions in Syria and Ukraine and European leaders’ own struggle with the second-order effects of the Syrian Civil War. The upshot is that Europe, caught between the menaces of Islamic terrorism and Russian imperialism, seems to be gradually prioritizing the former over the latter.

It’s quite possible, for instance, that Putin’s military adventure in Syria could indirectly bring Russia a measure of economic relief. While defending Assad was clearly one of Moscow’s main motives in launching air strikes against “terrorists” this fall, another was undoubtedly to become a key player in Syria and force the United States, European countries, and other regional powers involved in the conflict to reckon with Russia. Russian negotiators may not state explicitly that an alliance against jihadism, and a solution to the Syrian Civil War and its accompanying refugee crisis, cannot be forged while their country is pinned down by sanctions. But Putin has nevertheless turned a bombing campaign into new diplomatic leverage that can be deployed against those sanctions. And that leverage comes at a ripe moment, when ISIS’s attacks in Paris, combined with fallout from the refugee and migrant crisis in Europe, have popularized the notion that establishing European defenses against terrorism must be elevated above other issues.

At the same time, Putin is slowly, and fitfully, retreating from some of his aggressive, expansionist stances. In the fall, around the time that Russia launched its military intervention in Syria, pro-Russian soldiers and weapons systems were withdrawn from eastern Ukraine. But the situation is still unstable and has recently produced a surge in reported violations of the ceasefire. Nonetheless, Russia-supported separatist leaders have been stating that, as far as they are concerned, the war there is over. At least rhetorically, the Kremlin seems to be curbing its belligerence as well. The Russian government recently even offered to help Ukraine restructure some of its debt to Russia and stabilize its economy (while simultaneously threatening to increase its existing sanctions against Ukraine if the Ukrainian government pursues a free-trade deal with the European Union).

Meanwhile, the Russian president who attends international forums these days is far less bellicose against the West than the one who just months ago gave fiery speeches about the “New Russia” that would not be stopped in its quest to recover territories lost after the end of the Cold War—and would be feared and respected by the rest of the world once again. Putin’s more conciliatory tone is presently being tested by Turkey’s downing of a Russian military plane near Syria, which so far has elicited from Russia harsh language, economic sanctions, and accusations that Turkish leaders are supporting ISIS, but no military retaliation.

At a Group of 20 summit in Turkey last month, U.S. and European leaders reportedly agreed to extend sanctions on Russia for six months after the January deadline. This would seem to suggest that the sanctions regime has staying power, but the decision could also be read as a bet that over the next six months, Russia’s behavior and the situation in Ukraine could improve to the point where sanctions will no longer be necessary.

But these leaders may be overlooking what is perhaps the main determinant of the less combative Putin now on display: The price of Russia’s main exports, oil and gas, have plummeted from highs that until last year helped fill the Kremlin’s coffers and gave it the wherewithal to pursue an aggressive, fiercely independent foreign policy. Oil that once sold at more than $100 a barrel is now at less than $60, and the Russian government needs it to rise to $105 to balance its budget. It’s not surprising, then, that Putin is interested in doing whatever is necessary to eliminate Western sanctions. They have already cost the Russian economy more than 1 percent of its GDP.

If Europe stays united—ensuring that sanctions on Russia are preserved until there is a credible and durable ceasefire in Ukraine, and thus pressuring the Kremlin to abandon its attempts to “recover” the country—a relatively good outcome could be fashioned from a welter of conflict: Putin’s imperialistic adventurism in Europe could be contained, even as the West gains an important ally in the fight against the Islamic State. That wouldn’t be so bad.