It would appear unwise for Israel (or any country for that matter) to insert itself into additional intractable conflicts, so when Haaretz reported that a plane from Azerbaijan’s defense ministry landed in Israel twice during four days of clashes in the self-declared and largely unrecognized republic of Ngorno-Karabakh last month, it raised some eyebrows. But Israel’s slight embroilment in a severe greater-European security emergency doesn’t necessarily amount to foreign policy recklessness. If anything, it’s a sign of Israel’s surprising freedom of action at the moment—a time when the country’s foreign policy is in a more commanding position than it might appear.

Ngorno-Karabakh is a majority-Armenian region, and current Armenian-controlled separatist enclave, that remained within Azerbaijian’s territory after the former Soviet Republics became independent in 1991, sparking a war that killed as many as 30,000 people. A 1994 ceasefire left some 16% of Azerbaijan’s internationally recognized territory under Armenian control. There’s been little real progress towards peace since then.

Armenia is closely allied with Russia and Iran, while Azerbaijan is a Turkic-speaking country with cultural, historical, and political ties to Ankara. Russia and Turkey don’t quite get along these days, and a renewed war in Ngorono-Karabakh—at worst, a full-blown Russo-Turkic proxy conflict in the central Caucasus—belongs on the short-list of plausible geopolitical nightmare scenarios. This month’s fighting was especially awkward for Israel: Thanks to their close defense relationship and shared antipathy towards an Iranian regime ensconced directly to the country’s south, Azerbaijan is one of Israel’s closest majority-Muslim allies.

The Ngarno-Karabakh fighting—Haaretz reported that 112 people have thus far died due to the conflict there—and Israel’s apparent bit role in the outburst, did not come at convenient time for Israel’s foreign policy. Russia and Israel are just one mid-air collision over Syria away from a diplomatic crisis while a “deconfliction” agreement between the countries has likely preserved Israel’s ability to go after Hezbollah targets in the country. Israel and Russia are effectively on opposite sides of the Ngorno-Karabakh conflict: a modest Russian deployment in Armenia acts as a deterrent on an Azeri military strike to reclaim the territory, while Israel is Azerbaijan’s only supplier of advanced weaponry, according to a 2015 paper by the Israel-based Institute for National Security Studies’ Gallia Lindenstrauss. As Lindenstrauss notes, the Organization for Security and Cooperation in Europe maintains an “embargo on arms sales to Azerbaijan and Armenia, at the declarative level at least.” Israel considers its relationship with Azerbaijan to be more important than any nonbinding OSCE directive: According to Haaretz, Israel has sold Azerbaijan some $5 billion in weaponry over the past four years.

Notably, Israel has helped Azerbaijan keep its military options open—without going gone quite as far as it could in backing Baku’s position in the Ngarno-Karabakh conflict. As retired IDF general Efraim Sneh observed in an April 15 piece in Al Monitor, Israel hasn’t called for an Armenian withdrawal from Azberbaijan’s territory and has done little to back its ally in the diplomatic sphere in the wake of the flare-up. Sneh attributes this to similarities between Armenian occupation of Azerbaijan’s land and Israel’s occupation of the West Bank: In calling for a military withdrawal in what Sneh believes to be an analogous situation, Israel would only draw attention to its own failure to remove its troops from land that doesn’t belong to it.

There are other possible explanations: Israel might think that the status of Ngorno-Karabakh is a matter better left for Armenia and Azerbaijan to determine. And while it’s one thing to provide military assistance—which remains largely hidden from public view, save for the occasional Haaretz article—a diplomatic spat with a Russian ally would be a more public and potentially messier affair.

There’s perhaps an even more straightforward explanation for Israel’s seemingly hazardous and self-contradictory stance in the conflict. For the time being, Israel enjoys remarkable and perhaps unprecedented strategic depth in its region. Israel has competently navigated a Syrian civil war that has flummoxed or destabilized every neighboring country. The various Palestinian factions are weak and divided. Israel’s in the process of normalizing relations with Turkey. Even Saudi Arabia is now essentially guaranteeing the country’s access to the Red Sea and the Indian Ocean.

There are looming threats to Israel’s strategic depth—Iran and various United Nations Security Council resolutions among them. But for now, Israel is in a strong enough position to forge a relationship with a country like Azerbaijan on its own terms—and regardless of the potential consequences.

Previous: Egypt Gifts Saudi Arabia Two Strategic Islands in the Red Sea; Informs Israel