Strong Turkish political support, cutting-edge Turkish drones and experienced Turkish military advice skewed the balance towards Azerbaijan and allowed it to roll over Armenian positions in what was considered to be the near-impregnable mountain fortress of Nagorno-Karabakh.
Last weekend Azerbaijani President Ilham Aliyev said his soldiers had captured the town of Shusha and that their next target was the Armenian capital in the region, Stepanakert. Armenia denied that it had lost control of Shushi, as Armenians call the town, but it was clear that Azerbaijan had scored major military successes.
Armenian Prime Minister Nikol Pashinyan probably had little choice but to agree to a humiliating peace deal that secures Azerbaijan's dominance and forces his soldiers to leave the surrounding area.
Since a 1994 ceasefire ended the first war for Nagorno-Karabakh, fighting has flared sporadically between Azerbaijani and Armenian forces. Azerbaijan, though, achieved little of note in these skirmishes, highlighting just how impressive its successes have been in the past six weeks.
The difference has been Turkey and now it will reap the political rewards. For Turkish President Recep Tayyip Erdogan, an expansionist foreign policy is central to his self-image. He has forces in neighbouring Syria and in Libya and now wields major influence in the South Caucasus.
Ankara has also pushed Central Asian governments, with their Turkic and Islamic connections, to support Azerbaijan. Hard power impresses these former Soviet states and Turkey's kudos will rise.
Armenia and Prime Minister Pashinyan are the big losers. The idea of an out-gunned but plucky Armenian army defending Nagorno-Karabakh from Azerbaijan is central to modern Armenia. For Pashinyan to lose control of the region only two years after he was propelled into power in a revolution will probably cut short his political career.
The war has also shown up Russia's limited room for manoeuvre in the South Caucasus. It now needs Turkish support, even if it is in the background, to impose stability. The Kremlin tried twice to impose ceasefires but both collapsed. Only now, when the war was nearing a conclusion and several thousand people had been killed, was the Kremlin able to get a peace deal across the line. The price has been to commit 2,000 Russian soldiers as peacekeepers.
As for the West, it has looked decidedly uninterested.
An attempted US-negotiated ceasefire collapsed almost as soon as the ink was dry on the paperwork. Distracted by the coronavirus, terrorist attacks and a presidential election in the US, the West has missed the significance of war in this former Soviet backwater.