There’s not much that brings together Armenia and Azerbaijan. But the U.S.’s assassination of a senior Iranian official prompted similar, Tehran-sympathetic responses from the two countries, both of which border Iran.

Following the January 3 killing of Qasem Soleimani, the head of Iran’s Islamic Revolutionary Guard Corps, the foreign ministries of both Armenia and Azerbaijan issued statements broadly supportive of Tehran (and implicitly critical of the U.S.) in near-identical language.

Armenian Foreign Minister Zohrab Mnatsakanyan “expressed condolences to the Government and people of Iran on the demise of the high ranking Iranian official,” while his Azerbaijani counterpart Elmar Mammadyarov “expressed deepest condolences to the leadership and the people of the Islamic Republic of Iran on the death of general Qasem Soleimani.” Both foreign ministers spoke by phone with their Iranian counterpart Javad Zarif.

In Armenia’s protectorate of Nagorno-Karabakh, some officials went quite a bit further in their support of Iran. “The murder of Soleimani is reckless adventurism,” the chairman of the de facto republic’s security council, Arshavir Garamyan, said in a Facebook post. “Soleimani was committed to serving the interests of his country and people, therefore vengeance is matter of honor for the state, people, and soldiers of Iran, in particular for its intelligence and secret services.”

(The statement from Karabakh’s foreign ministry, however, was more measured, not offering any condolences to Iran and calling only for “the reduction of tension and settlement of the situation exclusively by peaceful means.”)

Despite its size and outsized influence in other parts of its neighborhood, Iran plays a relatively minor role in the Caucasus. Nevertheless, both Armenians and Azerbaijanis seek support from Tehran in their ongoing conflict with one another, even as the Iranian government has refrained from taking sides and keeps friendly ties with both countries.

While Baku and Yerevan also try to keep close ties with Washington, in this case both neighborly relations and the indefensibility of the American attack appear to have won out.

The sensitivity of ties with Iran was underscored by a bizarre “fake news” episode in Armenia in which a Facebook user under a pseudonym reported that Prime Minister Nikol Pashinyan had “congratulated” U.S. President Donald Trump on a “successful operation.” The post would likely have been ignored had it not been picked up by Azerbaijani media, which gleefully reported on it.

Pashinyan responded publicly, writing on his Facebook page that “this news soon emerged in the Azerbaijani press, becoming the news of the day. From the Azerbaijani press the news moved to the Iranian press, becoming the source of anti-Armenian feeling among some forces. This is a case where the false ‘freedom’ of speech endangers our national security. The authors of the news should be found and their motives determined.”

Soon enough, his wish came true: the National Security Service arrested a man it said was behind the post, and reported that the suspect said he was motivated by his support for ex-president and Pashinyan nemesis Robert Kocharyan.

It all seemed a bit convenient for some: a journalist from RFE/RL, in an interview with independent opposition member of parliament Arman Babajanyan, said the suspect’s confession sounded “Soviet-style.” Babajanyan agreed, noting that the Facebook page in question also had been posting fake news during the 2016 war with Azerbaijan, a far more sensitive time, and that the security services didn’t interfere.

“[T]his is a very troubling development, since this is the second case, when a Facebook user has been detained after [Pashinyan] directly instructed the National Security Services to take action,” wrote Yerevan-based journalist Artur Papayan in a blog post.

Azerbaijan, meanwhile, had its own concerns about domestic reactions to the U.S.-Iran crisis. Many in the majority-Shia country sympathize with Iran to a greater degree than the resolutely secular government would like, and in the wake of Soleimani’s killing many Azerbaijani Facebook users posted his photo as their profile picture.

One prominent imam in Baku, Ilgar Ibrahimoglu, wrote on Facebook that Soleimani was a “martyr” and that “we are confident that these pure martyrs' blood will lead to further strengthening of the Islamic Ummah [community] and defeat of the enemy.”

But both pro-government figures and the country’s political opposition took a different line. “My critical attitude toward the government is well known,” wrote Ali Kerimli, the head of the opposition Popular Front Party of Azerbaijan, wrote on Facebook. “But I support the government’s approach to keeping Azerbaijan out of potential conflicts in the region.”

In Georgia, the response predictably took into account first and foremost Tbilisi’s close relationship with Washington. “We condemned recent violence, provocative attack to the US Embassy in Baghdad. US has the legitimate right to defend its citizens,” wrote Foreign Minister David Zalkaliani on Twitter. (It was an attack by an Iranian-supported militia on the U.S. embassy in Baghdad that precipitated Soleimani’s killing.)

And in Georgia’s Russia-backed breakaway regions of Abkhazia and South Ossetia, too, the official reaction was filtered through the prism of U.S.-Russia tension and largely followed the Kremlin line.

“South Ossetia strongly condemns the murder of the high-ranking Iranian general and does not accept terrorism in any form,” the territory’s de facto foreign ministry said in a statement. “The violent action by the U.S. is a blatant, unjustifiable violation of international law and a crude violation of the sovereignty of an independent state.”