Sometimes in foreign policy, the best course of action for a powerful country is the most limited, at least visibly. That may be the case now in the United States’ confrontation with a cornered but potentially venomous Iran.

The U.S.-Iran showdown is a classic test between a strong nation and a much weaker one. An embattled Tehran has seemingly tried to goad the United States, shooting down, allegedly mining ships near the Persian Gulf and allowing proxies to fire missiles at civilian airports in Saudi Arabia. President Trump hasn’t retaliated militarily, but his loose talk Tuesday of the “obliteration” of Iran keeps the pot boiling, as Tehran probably wants.

Trump should keep the lid on, but this week demonstrated how difficult that will be. On Wednesday, Iran’s supreme leader, Ayatollah Ali Khamenei, again spurned Trump’s call for diplomacy. “Negotiation is an effort to deceive [Iran] into doing what the U.S. desires,” he said. Its defiance moved into a higher gear Thursday when, by its own account, Iran said it would break the cap on uranium enrichment set by the 2015 nuclear agreement.

History teaches us that ruinous wars often begin when powerful nations misjudge weaker ones or think that they can determine political outcomes by force. That’s the obvious lesson of the wars in Iraq and Afghanistan, where the United States assumed it could gain quick, decisive victories against weaker adversaries. Modern British historians make a similar assessment of World War I, where combatants rushed to war in the expectation of rapid triumph, oblivious to the horrors of trench warfare that lay ahead.

America, itself, was born amid one of history’s greatest misjudgments, in Britain’s belief that the colonial rebellion could quickly be crushed. As Rick Atkinson recounts in his book “The British Are Coming,” King George III and his advisers talked themselves into war, believing that the American insurgents were weak, unpopular and easily intimidated — and that “defeat in America spelled the end of empire.”

Trump, in comments Wednesday to Fox News, expressed a hubris common among great powers throughout history. He insisted that any war with Iran “wouldn’t last very long” and that combat would be limited: “I’m not talking boots on the ground.”

If Trump read more history, he might see another recurring weakness in his foreign policy. Disastrous wars often begin because powerful nations ignore weaker nations’ need to maintain the appearance of dignity. Trump seems to think he can disrespect foreign leaders to the point of humiliating them, and then soften them up with flattery and invitations to negotiate.

The president’s combination of insult and ingratiation is his foreign policy trademark, but it hasn’t worked very well. He remains deadlocked with such adversaries as Iran, North Korea, the Palestinians, Venezuela and China. And he has needlessly offended allies such as Germany, France and Japan. His gratuitous insult of Japan for freeloading on U.S. defense spending, while on his way to Osaka, may be a new low.

Part of Trump’s problem is that his unpredictability has now become so predictable. Watching Trump’s nasty tirades and tiffs, other nations are learning how to play the disruption game, too. Iran’s supreme leader scorns Trump’s offer to negotiate; France’s president threatens to reject a Group of 20 communique that doesn’t meet his demands on climate change; North Korea’s leader flirts with China even as he exchanges letters with the White House.

Israel’s response as this crisis escalates, interestingly, is to reach for diplomatic help from its new friends in Moscow. Prime Minister Benjamin Netanyahu this week hosted the national security advisers of Russia, the United States and Israel to talk about removing Iranian forces from Syria. “I believe that there is a wider basis for cooperation between the three of us than many believe,” Netanyahu said.

The Iran confrontation now carries a genuine risk of military conflict. If Iran deliberately takes American lives, the United States will retaliate. But even in that extreme moment, each action will require a calibrated reaction. Skirmishes and shoot-downs are not the same as all-out war; an Iranian attack should not trigger an instant spasm of “obliteration” that would take decades to repair.

We should never be in this situation. Trump was unwise to abandon a nuclear agreement that was working and to harass the European allies that the United States needs to contain Iranian behavior in the region. The president and his advisers didn’t reckon adequately with Khamenei’s resistance to “maximum pressure.”

Trump must realize that he’s entering dangerous territory, politically as well as militarily. Perhaps it’s dawning on him that a needless war with Iran would be the most likely path to his defeat in 2020.

First published in the Washington Post. Cartoon by Schot.

David Ignatius, the best-selling author of Body of Lies and The Increment, among others, and prize-winning columnist for the Washington Post, has been covering the Middle East and the CIA for more than twenty-five years. He lives in Washington, DC.