But with Iran’s leadership demanding anew that the United States leave the region, it is expected that attacks by Tehran’s proxy forces will continue. Iran’s leadership can also, at a time of its choosing, decide whether to launch additional, asymmetrical strikes, especially cyberattacks, against Western interests. And that could bring both countries back to the edge of the cliff.

There was visible relief among some officials at the Pentagon that the highway to a larger war on which the administration appeared to be speeding may have provided an off-ramp.

For all of the public chest-thumping in the last week, both sides took measures to de-escalate.

Before the strikes on the bases in Iraq, Iran made clear that it would launch retaliatory attacks and that they would come from the official Iranian military, not proxy groups. The United States, for its part, was monitoring Iranian communications and had plenty of time to prepare to protect American troops in Iraq.

By the end of a long night Tuesday, there was a collective exhaling in the Trump administration’s national security apparatus, and officials indicated that they believed things had been contained, for now.