Moscow, Russia – Azerbaijan is claiming victory as a deal is struck to end a brutal conflict with Armenia in Nagorno-Karabakh. Russia, the mediator, wins too.

Few thrive in chaos like Russia does.

A trilateral agreement between Azerbaijan, Armenia and Russia looks likely to mark the end of a 44-day war over mountainous Nagorno-Karabakh. It’s been the theater for brutal clashes that displaced tens of thousands and raised the threat of a wider regional conflict. The deal is a propaganda coup for Azerbaijan’s leader, Ilham Aliyev. It’s a decent outcome for Moscow, too.

With winter approaching and the coronavirus taking its toll, the truce is a humanitarian blessing. For the Kremlin, it’s also a diplomatic one. After months of watching crisis after crisis in its post-Soviet sphere of influence, President Vladimir Putin has reasserted Russia as regional guarantor of stability, with nearly 2,000 peacekeepers to prove the point. Turkey’s backing was certainly vital, given its vocal support for Azerbaijan, but there is no formal role for Turkey in the deal which came into effect on Tuesday. It was still Russia that brokered and signed – in time to avoid a full Azeri takeover of the enclave. European Union (EU) and the US are entirely absent.

The current dispute over the largely Armenian-populated sliver of land dates back to its establishment as an autonomous province within Soviet Azerbaijan in the early 1920s. The Soviet Union’s collapse reawakened the question of Nagorno-Karabakh’s fate, and a war followed that killed 30,000 and displaced a million before a Russian-brokered truce was struck in 1994. Without a permanent peace deal, the conflict simmered with occasional skirmishes until the fighting that started in late September 2020.

Backed by Turkey, Azerbaijan notched up significant military successes and over the weekend took the fortress city of Shusha, known as Shushi in Armenian, a strategic stronghold. That proved a turning point.

Armenia had little choice but to make the “unspeakably painful” concessions laid out by Prime Minister Nikol Pashinyan. “There’s no defeat unless you consider yourself to be a loser,” he said, but this was no victory. The country will withdraw from districts around Karabakh held since the 1990s. An angry mob stormed the government building in the country’s capital Yerevan.

Aliyev, meanwhile, has triumphantly wrapped himself in the flag. He gets long-desired concessions, including Russian-protected access to Nakhchivan, a geographically separated district. With even Azerbaijan’s political opposition behind his campaign, it’s a helpful boost at a time when falling crude is squeezing an oil- and gas-dependent economy.

For Russia, the peace dividend doesn’t look bad either.

It’s possible to argue that Turkey’s presence alone points to fading Caucasus clout, and Russia is certainly stretched, as written before. The agreement is still the best available outcome for the Kremlin. As Alex Melikishvili of IHS Markit told me, Turkey’s role reflects Russia’s pragmatism. It would have been difficult to end hostilities without offering Turkey a stake. But it remains secondary, and outside the conflict zone.

In a year when little has gone Russia’s way because of the oil crash and pandemic, he clinched an agreement based on terms largely brushed aside before. Moscow is now a literal watchman in the region, with retreating Armenian forces giving way to Russian peacekeeping troops, on a renewable five-year mission.

The success is not unalloyed. There’s a lot yet to consolidate here, not least the long-term status of Karabakh. There’s no disputing that Turkish President Recep Tayyip Erdogan has muscled into the Caucasus, and possibly secured access to the Caspian Sea and ultimately Central Asia through Azerbaijan. Turkish peacekeepers, mentioned by Baku but not the official statement, are a coup for Ankara and a headache for the Kremlin – even if they remain in a ceasefire monitoring center outside the enclave. It’s an unprecedented complication, as Maximilian Hess of the Foreign Policy Research Institute points out, and Russia will be reluctant to have a NATO member’s troops anywhere in the former Soviet Union.

Moscow has lost hearts and minds in Armenia too, an unhelpful development after it antagonized the Russia-friendly population of Belarus by supporting President Alexander Lukashenko following August’s disputed election. Larger aims prevailed.

Russia is reactive. Having failed to prevent a war in its sphere of influence, it was nevertheless able to take the lead and pull out a win of sorts. In 2020, that can count as success.