On Monday, Israel bombed a building that was part of the Iranian Embassy complex in Damascus, killing seven people, including Gen. Mohamad Reza Zahedi, who oversaw Iran’s covert military operations in Syria and Lebanon, and two other senior generals.

For centuries, diplomatic premises have been afforded special protections. Diplomats get immunity from prosecution in their host country, and embassy buildings are often viewed as a sanctuary for their nation’s citizens — they cannot be entered by the host country’s police without the permission of diplomatic staff, and often become refuges for expatriates in times of war.

So attacks on diplomatic compounds carry particular weight, both in law and in the popular imagination. But in this case, experts say, Israel can likely argue that its actions did not violate international law’s protections for diplomatic missions. Here’s why.

Diplomatic buildings are entitled to broad protections from attack or other interference by the host country under international customary law, codified in the 1961 Vienna Conventions on Diplomatic and Consular Relations.

Article 22 of the Convention on Diplomatic Relations states:

“The premises of the mission shall be inviolable. The agents of the receiving State may not enter them, except with the consent of the head of the mission. The receiving State is under a special duty to take all appropriate steps to protect the premises of the mission against any intrusion or damage and to prevent any disturbance of the peace of the mission or impairment of its dignity.”

Those protections remain in force even if the embassy is used for criminal or military purposes. The receiving state can break off diplomatic relations, or revoke the diplomatic immunity of specific individuals and eject them from the country, but it must still “respect and protect” the embassy buildings and their contents even after the mission has closed.

Consulate premises are likewise inviolable under Article 31 of the Vienna Convention on Consular Relations. In a particularly shocking example of how that can play out, after the journalist Jamal Khashoggi was murdered inside the Saudi Consulate in Turkey in 2018, Turkish officials had to wait for days before they were finally given permission to enter.