For now we seem to have averted an all-out shooting war between the United States and Iran.

Yet it’s not over. The world is more dangerous than it was a week ago, and President Trump’s exuberance suggests that he may have learned precisely the wrong lesson from his clash with Iran.

Trump and some of his supporters are crowing at the lack of American casualties — Iran may have carefully aimed so as to miss people — in ways that remind me of the hubris preceding the 2003 invasion of Iraq. As there were then, there are today concerns about whether intelligence has been overstated, leaders are thumping their chests and there’s too much confidence in the ability of the military toolbox to solve complex problems.

Trump, who in 2012 repeatedly claimed that President Barack Obama would start a war with Iran to help win re-election, is already running election ads on Facebook trumpeting his killing of Maj. Gen. Qassim Suleimani and saying that this is “keeping America safe.” Hmm. Look at the results so far:

Iran has cast off nuclear curbs so that it is now potentially within five months of having enough fuel for a nuclear warhead, down from almost 15 years when Trump took office.

United States forces may be pushed out of Iraq, allowing Suleimani to achieve in death one of his foremost goals in life.

American forces in Syria may be difficult to support without the military presence in Iraq, so some or all of them might pull out as well, another strategic victory for Iran.

The military campaign against ISIS is on hold, giving terrorists a chance to regroup.

Iran’s regime, which had been threatened by enormous protests at home and in Iraq, has been rescued by Trump’s actions. Iranians have rallied around the flag, and the Iraqi narrative has changed overnight from the bullying of Iranians to the bullying of Americans.

Instead of bringing troops home, Trump has had to deploy more to the Middle East at huge cost. We may think we can’t afford universal pre-K, but we don’t blink at lavishing billions of dollars on these military deployments.

North Korea has gained leverage, because it knows that Trump has little appetite for two international security crises at the same time. Kim Jong-un has also surely absorbed the lesson that he must never give up his nuclear warheads, as Trump will strike countries that lack nuclear weapons while schmoozing with leaders who have them.

So much winning! And there will be more.

It’s true that Iran’s foreign minister, Javad Zarif, said that Iran’s response had “concluded,” but Zarif is a moderate often outmaneuvered by hard-liners. I know this partly because back in 2004, after Zarif approved a visa for me, I was detained in Iran by security forces looking for information that could embarrass Zarif and get him fired.

My best guess is that Iran will strike back hard in a way that leaves it some plausible deniability. Perhaps it’ll be a truck bomb at a diplomatic mission or Trump property, or perhaps rocket attacks on a military site by a proxy, or a cyberattack on an oil refinery or the power grid, or perhaps mines that damage oil tankers in the Strait of Hormuz. Iran has options, and let’s not celebrate prematurely.