On 31 August, in a deeply provocative move, Azerbaijani President Ilham Aliev pardoned convicted murderer Ramil Safarov on his return to Baku from a Hungarian prison.
Safarov had been attending a Nato training-course in 2004 when he killed Armenian fellow officer Gurgen Markarian with an axe while he slept.Back in 2004, the brutal killing on ethnic grounds caused an inevitable upsurge of emotion in both Armenia and Azerbaijan, which have been waging a conflict in various forms over the disputed territory of Nagorno-Karabakh since 1988.
There was an upsurge in the war of words in the media, which generally goes further than what officials allow themselves to say.
Markarian was given a state funeral. In Azerbaijan a few members of parliament dared to call Safarov a "hero," but many Azerbaijanis felt ashamed at how his action reflected on their country and, mercifully, government officials mostly kept silent.
Eight years on, that has all turned round.
This is now a full-blown state-to-state row, with as yet unknowable consequences. For reasons that have yet to be fully explained, the Hungarian government negotiated the extradition of Safarov to Baku having secured an agreement, they maintained, that he would only be eligible for parole after having served the remainder of a 25-year prison term in an Azerbaijani jail.
Instead, Safarov was pardoned. Leaving him a free man without public comment would have been bad enough. The Azerbaijani government went much further than that, treating Safarov as a hero. He was given an apartment in Baku and personally promoted to the rank of major by the defence minister.
Every action has a reaction. Unsurprisingly, the US government and the Russian foreign ministry reacted to the news with strong disapproval.
The spokeswoman for EU foreign policy chief Catherine Ashton also expressed alarm but stopped short of directly criticising its own member state, Hungary. The EU already has enough problems with controversial Hungarian Prime Minister Viktor Orban.
As for Armenia, it appears to be close to boiling over. It has suspended diplomatic relations with Hungary and observers of the Karabakh negotiating process - already on the verge of failure - are watching apprehensively for what it will do next.
The Armenian government was already telling all foreign interlocutors how unhappy it was with the state of the peace process. There were tough questions to US Secretary of State Hillary Clinton in June as to why there was not a sharper US response to violations of the Armenian-Azerbaijani ceasefire, which are widely perceived to come more from the Azerbaijani side.
Yerevan could now be tempted to suspend its participation in the peace talks.
Some Armenian commentators are calling for more extreme steps such as recognising breakaway Armenian-controlled Nagorno-Karabakh as an independent state. There will also be the inevitable worry that a fanatical Armenian will try to commit a revenge attack.
From the political perspective, to call the Azerbaijani government's actions a mistake is an understatement. It is a worrying indication of the quality of advice that President Ilham Aliev is receiving from his inner circle.
Over the past few years, the government in Baku has spent tens of millions of dollars of its new oil revenues promoting the image of Azerbaijan as a new, modernising, dynamic country. The effect has been quite successful, with results ranging from Azerbaijan joining the UN Security Council to Baku hosting feel-good events such as the Eurovision Song Contest.
All that PR work now has to contend with a contrary image, of the government welcoming home an axe-murderer.
Sadly, the events of this week are a big boost for radicals on both sides.
They strengthen the hands of those Armenian hardliners who say that this proves that Azerbaijanis are barbarians who cannot be trusted.
In Azerbaijan, I know a substantial number of non-governmental activists and middle-level officials who have been working quietly on dialogue projects with Armenians. It is hard to see those going forward in the current environment.
If there is any silver lining to this dark episode it could be that the international community pays more attention to the dangers of a new Armenian-Azerbaijani conflict over Nagorno-Karabakh. The conflict is not "frozen," as it is frequently described.
The current format of quiet mediation by France, Russia and the US is not strong enough to move the two sides from their intransigent positions. The reception given Safarov suggests that the situation is moving closer to war than peace. This slide can be halted, but the time to start working harder on diplomacy is now.
The Carnegie Russia and Eurasia Program has, since the end of the Cold War, led the field of Eurasian security, including strategic nuclear weapons and nonproliferation, development, economic and social issues, governance, and the rule of law.
You are leaving the website for the Carnegie-Tsinghua Center for Global Policy and entering a website for another of Carnegie's global centers.