(Bloomberg Opinion) -- Recep Tayyip Erdogan’s alliance of convenience with Vladimir Putin has survived conflicts of interest in Syria and Libya, but it faces a sterner test in the Caucasus, where the outbreak of hostilities between Armenia and Azerbaijan puts the leaders of Turkey and Russia in opposition. And having burned his bridges with Europe and expended most of his brownie points with the U.S., Erdogan clearly has the weaker hand.

Historically, the region has sat in the Venn-diagram overlap of Russian and Turkish spheres of influence; in recent decades, Moscow has had the stronger claim. Although the Caucasian republics broke free with the collapse of the Soviet Union, Russia sees itself as the regional policeman, dispensing punishment and making peace as the Kremlin deems fit.

Ankara has accommodated some of Moscow’s maneuverings in the area between the Black Sea and the Caspian Sea. For example, Erdogan was careful not to cross Putin when Russia invaded Georgia in 2008. But Azerbaijan is another matter.

Turkey and Azerbaijan are connected not only by history, religion and language, but also by oil and natural-gas pipelines, which are crucial to Erdogan’s ambition of making his country the indispensable energy corridor between the Caspian Sea and Europe. Turkey has consistently sided with Azerbaijan’s claims to Nagorno-Karabakh, a majority Armenian-populated region. When the Soviet Union collapsed, Armenia took control of the mountainous region, along with seven adjacent districts.

Russia brokered a cease-fire between Armenia and Azerbaijan in 1994. The region has since remained in Armenian control, but is internationally recognized as belonging to Azerbaijan. Despite mediation by Russia, the U.S. and France, the two countries have not been able to agree on a permanent peace deal.

Now, Azeri President Ilham Aliyev is making a determined effort to end the stalemate by military means. And Erdogan is openly backing him. The Turkish leader puts the blame for the fighting entirely on the Armenian government, which he describes as “the biggest threat to peace in the region.” He has called on Armenians to stand against their leadership.

Turkish support for Azerbaijan is not merely rhetorical. The countries conducted joint military exercises last month, after the skirmishes with Armenia left several Azeri troops and civilians dead. Turkish forces have a presence at an army base in Azerbaijan and access to an air base there. Erdogan has pledged to upgrade Azerbaijan’s military equipment and supply new gear, including drones and missiles.

For its part, Russia sells arms to both sides, but tilts toward Armenia, where it maintains a military base. Armenia is part of the Moscow-led Collective Security Treaty Organization — the very treaty Belarusian dictator Alexander Lukashenko has invoked to justify a possible Russian military intervention in his country. Azerbaijan is not a CSTO member.

But Putin seems keen to bring the two countries back to the negotiating table and has refrained from blaming either side for the fighting. It’s safe to say he will not be pleased with his ally’s rhetorical broadsides, nor will he tolerate a Turkish military intervention.

It won’t be lost on Putin that Erdogan is already stretched, with military operations in Libya and Syria as well as a geopolitical face-off in the Eastern Mediterranean — where Russian warships are also lurking. An intervention in the Caucasus will strain Turkey’s economy, already in dire straits. The lira tumbled to a new low on the possibility of the country becoming involved in the Azeri-Armenian war.

In the Caucasus, Putin can afford to play the longer game. For all of Erdogan’s bellicose rhetoric and Turkish assistance, Azerbaijan faces an uphill battle — literally — against Armenian positions. Despite expressions of alarm from U.S. President Donald Trump and European leaders, the Russian president knows that the belligerents will inevitably turn to him for a way out of the fighting. Russia is the only major power with both a stake in stability in the Caucasus and the will to impose it.

Erdogan, having committed himself to the Azeri cause, will find it harder to climb down. His best hope for saving face is that Putin will give him a seat at the negotiating table. But that may require the Turkish leader to make concessions in other areas where he is at cross purposes with his “dear friend” in Moscow.

This column does not necessarily reflect the opinion of the editorial board or Bloomberg LP and its owners.

Bobby Ghosh is a Bloomberg Opinion columnist. He writes on foreign affairs, with a special focus on the Middle East and Africa.

©2020 Bloomberg L.P.