Israel has carried out an airstrike on a weapons depot in Iraq that officials said was being used by Iran to move weapons to Syria, an attack that could destabilize Iraq and thrust it deeper into the conflict between the United States and Iran.

The attack, believed to be the first Israeli bombing in Iraq in nearly four decades, represents an expansion of the military campaign Israel has carried out against Iranian targets in Syria.

The Israeli attack last month was one of several recent attacks on weapons storage facilities controlled by Iraqi militias with ties to Iran. It was not clear who carried out the other attacks, which have set Iraq on edge as it struggles to recover from nearly 40 years of war and instability.

Responding to the attacks on Thursday, Iraq’s national security adviser, Falih al-Fayadh, said that Iraq wanted to avoid taking sides in any struggle between Iran and other countries and being “pushed into a war.”