And if Iran wanted to kill Americans, any of those groups could do that on its behalf, with some deniability, said the experts. Shiite militias could overrun the U.S. Embassy in Baghdad and seize hostages. Hezbollah, which, before 9/11, had killed more Americans than any other terror group, could strike in places as far flung as Latin America, where the group has a strong presence.

"Traditionally, when faced with this sort of American action, Iran doesn't tend to respond directly and immediately, but they do so asymmetrically and over a period of time," said Ray Takeyh, a former State Department official and Iran expert at the Council on Foreign Relations.

Trump said in a tweet Friday that he stopped a U.S. attack on Iran that would have targeted three sites. He told NBC's Chuck Todd in an exclusive interview Friday that, after being told the attack could cost 150 Iranian lives, he decided it was not proportional to the downing of an unmanned spy drone.

....On Monday they shot down an unmanned drone flying in International Waters. We were cocked & loaded to retaliate last night on 3 different sights when I asked, how many will die. 150 people, sir, was the answer from a General. 10 minutes before the strike I stopped it, not.... — Donald J. Trump (@realDonaldTrump) June 21, 2019

The U.S. and Iran have been attacking one another covertly for decades. President Barack Obama is believed to have ordered a cyberattack that employed malware known as Stuxnet to set back Iran's nuclear program by causing centrifuges to malfunction, for example. Iran built powerful bombs that killed American troops in Iraq.

But the last time an American president authorized a military strike on Iranian forces was in the 1980s, when Iran was fighting a war against Iraq and attacking tanker traffic in the Persian Gulf. In April 1988, an Iranian mine wounded 10 sailors on the USS Samuel B. Roberts. American forces responded by destroying much of Iran's small navy and taking out two oil platforms used by the Islamic Revolutionary Guard Corps.

After a U.S. guided missile cruiser accidentally shot down an Iranian passenger airliner in July 1988, killing 290 civilians, Iran capitulated, believing the shootdown was not an accident.

But analysts say Iran's capacity to inflict pain on the U.S. and its allies is much greater than in the 1980s, experts say.

In addition to its extensive proxy forces, Iran has a potent cyber capability that could, in theory, take down networks and harm the American economy. Iran is believed to be responsible for a cyberattack that wiped out 35,000 computers at the Saudi oil company Aramco in 2012.

The U.S., of course, could inflict massive damage on Iran. American forces could obliterate Iran's entire navy in two days, according to a recent Pentagon analysis, described by multiple U.S. officials. But Iran's clerical regime, which cares most about its survival, may respond to that in unpredictable ways.

"Very quickly we could end with miscalculation as both sides fear offensive action by the other or tit for tat that escalates into a much more significant conflict," said Ilan Goldenberg, director of the Middle East Security Program at the Center for New American Security, on Twitter.

The U.S. might believe it was sending Iran a message of deterrence by punishing it with limited air strikes. But Iran could interpret those strikes as a precursor to an invasion, and act accordingly. The result could be full-scale war.

An all-out effort by the U.S. to depose the Iranian regime could cost trillions of dollars and untold American lives, Goldenberg wrote in a recent analysis.

"Even short of such worst-case scenarios, any war with Iran would tie down the United States in yet another Middle Eastern conflict for years to come. The war and its aftermath would likely cost hundreds of billions of dollars and hobble not just Trump but future U.S. presidents. Such a commitment would mean the end of the United States' purported shift to great-power competition with Russia and China," he wrote.

Trump has said he doesn't want that. The president told NBC News he is inviting Iran's senior leaders to talk.

"I'm not looking for war," Trump said to Todd. "And if there is, it will be obliteration like you've never seen before. But I'm not looking to do that. But you cannot have a nuclear weapon. You want to talk — good. Otherwise you're going to have a bad economy for the next three years."