Iraqi protesters stand outside the burned-down headquarters of the local government in Basra on September 7.Haidar Mohammed Ali / AFP / Getty

Shia militants in Baghdad are always prepared to attack U.S. facilities: They have encased pipes, which are aimed in the direction of the U.S. Embassy, in the ground near east Baghdad’s soccer pitches, Michael Knights, an expert on Iraq at the Washington Institute for Near East Policy, told me.   

“So any time you want to rocket the U.S. Embassy, you can just go find one of these holes in the ground, slide a rocket in, and fire it—and it’s going to head in that direction,” he said. “So that really gives you a sense of what a machine they’ve built for rocketing the U.S. Embassy.”

Indeed, recent rocket attacks on the U.S. Embassy in Baghdad and near the U.S. consulate in Basra, which the White House condemned in a statement on Tuesday, fit into a larger pattern. Shia militia in Iraq have spent years rocketing these facilities—though there has been an unspoken truce with the United States since 2014, when both sides fought ISIS. “This doesn’t come out of the blue,” Knights said. “This is their exact modus operandi. They have undertaken these kinds of attacks literally hundreds of times in the past.”

One thing that is new, however, is how the U.S. reacted this time: by condemning Iran directly for its influence over Shia militia in Iraq. Such attacks were common prior to 2014, and past administrations called out the Islamic Republic for them, but for the past four years the U.S. and Iran-backed Shia militia have had a common goal: defeating ISIS, which they more or less achieved last year.

“Over the past few days, we have seen life-threatening attacks in Iraq, including on the United States consulate in Basra and against the American embassy compound in Baghdad,” the White House said in a statement. “Iran did not act to stop these attacks by its proxies in Iraq, which it has supported with funding, training, and weapons.”

The statement added: “The United States will hold the regime in Tehran accountable for any attack that results in injury to our personnel or damage to United States Government facilities. America will respond swiftly and decisively in defense of American lives.”

The statement is part of a larger U.S. pressure campaign on the Islamic Republic that picked up speed last May when President Donald Trump withdrew the U.S. from the multilateral nuclear agreement with Iran. Since then, the U.S. has reimposed sanctions on the country and plans to go ahead with a more crippling set of restrictions in November targeting Iran’s lucrative oil-export revenue. It has simultaneously warned its allies—including those still party to the nuclear accord—that their companies will also be subject to U.S. sanctions if they continue to do business with the Islamic Republic. (The deal is predicated on Iran freezing its uranium-enrichment program in exchange for economic and political benefits.) The goal, the Trump administration says, is to get Iran to change its “behavior” to that of a “normal country.” In other words: no supporting terrorist groups, no interference in regional politics, no ballistic-missile development, no threats against Israel.

Although these measures will further hobble Iran’s already moribund economy, they will almost certainly be unable to stop Iran from acting in what it regards as its vital interest in its backyard. Shia Iran’s clerical regime is actively involved in propping up Bashar al-Assad in Syria, supports the Houthis in Yemen, wields considerable influence in Afghanistan, and, of course, dominates Iraqi politics through its funding of Shia parties and its arming of Shia militia. Yet it’s unclear how much Iran actually controls the Shia militia attacking American assets, as the White House statement suggests. Indeed, there are other Shia militia who have attacked Iranian assets.

“We are always trying to understand whether Iran ordered something or whether a militia in Iraq simply inferred that now would be the right time to make a nice gesture toward Iran,” Knights said. “That direct causality and ordering of attacks is something the U.S. is constantly looking out for.”

Take the rocket attack on the U.S. Embassy in Baghdad: It was carried out from an area controlled by Asaib Ahl al-Haq, a Shia militia group. According to newly declassified documents, in 2007 its leader, Qais al-Khazali, gave U.S. forces information on other Shia militia and the extent of Iran’s influence in Iraq.

“Asaib Ahl al-Haq does not need to be told to rocket the U.S. Embassy in Baghdad,” Knights said. “It’s probably decided to do that on its own. But it’s very close to Iran, so Asaib Ahl al-Haq knows when Iran would object to an escalation against the U.S. and Asaib Ahl al-Haq understands when Iran would welcome an escalation against the U.S. Because they’re very, very close to each other.”

That’s also the case with Kata’ib Hezbollah, the Shia group allegedly behind the rocket attack in Basra. That group is headed by Abu Mahdi al-Mohandis, a U.S.-designated terrorist who may also play a pivotal role in the formation of Iraq’s next government. (Indeed, the Institute for the Study of War notes that the firing of the rocket at the U.S. Embassy could be part of an intra-Shia jostling for power ahead of government formation.)

Basra is far to the south of where the U.S. coalition has been fighting ISIS; it has so far been spared most of the violence that wracked Sunni areas in the country’s north. The rocket attack on the U.S. consulate in Basra, a Shia-dominated city in Iraq’s south, came just days after protesters overran and looted the Iranian consulate in the city, setting parts of it on fire, a reflection of the rising anger against Iran’s role in the country. Given that this area is dominated by the Islamic Republic’s Shia coreligionists, those protests were extremely worrying for Iran. Al-Mohandis accused the U.S. of fomenting those protests.

“When the Iranian consulate gets burned, the U.S. consulate gets rockets,” Knights said. Kata’ib Hezbollah “probably do that of their own volition, but with Iran’s support and to the great satisfaction of Iran.”

I asked Ranj Alaaldin, an expert on Shia militias in Iraq at the Brookings Doha Center, about the influence such militias have in Iraq. “Shiite militias in Iraq are diverse and varied, and most are little more than rag-tag criminal groups,” he wrote in an email. “The largest, highly organized, resource-rich, battle-hardened and therefore the most powerful are Iranian proxies.”

Alaaldin wrote that Iran wields influence over these groups largely because their “relationship is personalized and stretches back to the pre-2003 era [prior to the U.S.-led invasion that ousted Saddam Hussein] when Iran invested heavily in different Shiite Islamist parties and armed groups to combat the Baath regime.” They serve, he said, “as a button and a buffer” for Iran; “a button that Iran can press to indirectly confront and intimidate those actors that threaten its interests and a buffer that allows Iran to distance itself from these proxies when they commit human rights abuses and engage in criminal activities, lest it becomes accountable for their actions.”   

Or as Knights put it, Iran is “a puppet master and a very effective one.”

“When Iran wants these militias to do something, the militias do it. When Iran wants these militias to stop doing something, they stop doing it,” Knights told me. “That’s why the U.S. government is warning Iran to put these militias in Iraq on notice to stop attacking U.S. diplomatic facilities.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.