Following the American drone strike near the Baghdad airport last Thursday that killed Iranian General Qassem Soleimani, it was assured that some sort of retaliation would be forthcoming from Tehran. The initial response came on Tuesday when Iran launched a series of ballistic missiles at the Al Asad and Erbil bases in Iraq where American troops are based. The strike and counterstrike provide some real-time lessons in deterrence, and how the use of force is but only one variable alongside deniability and domestic politics determining whether things will further escalate and plunge the Middle East into more turmoil.

From the U.S. perspective, assassinating Soleimani was justified. Soleimani commanded the Qods Force, the most elite branch of the Iranian Revolutionary Guard Corps, which is designated by the U.S. as a terrorist group along with its parent organization and is responsible for the IRGC’s foreign operations. Soleimani may have had more American blood on his hands than anyone else alive, being responsible for the deaths of hundreds of U.S. soldiers in Iraq through attacks organized and coordinated by him with Iranian proxy forces. While those of us without access to classified intelligence will never be able to assess whether or not Soleimani was in the process of planning an imminent attack on American assets, it is almost certain he was always scheming new ways to damage U.S. interests in the region. He was also responsible for fomenting chaos in Iraq, Syria, and Yemen and organizing attacks on U.S. regional allies. It is an understatement to say that he will not be missed.

But the larger reason for the U.S. to kill Soleimani, despite the shifting explanations and rationales from the Trump administration in the days following the operation and despite whatever cable television coverage and social media taunting motivated President Trump directly, was to establish deterrence against Iran. Over the past year, Iran has stepped up its attacks on American targets and on American regional allies with almost no response from Washington. Included in this list are the downing of a U.S. drone in June, mine attacks on shipping in the Persian Gulf last summer, the missile strikes on Saudi Arabia’s Abqaiq oil facility in September, and finally a rocket attack on the K1 base outside of Kirkuk two weeks ago that killed an American contractor and wounded a number of American personnel. As Iran pushed the envelope further and further without a robust American response, it encouraged even more brazen efforts by Iran to attack American interests, particularly given that a rational reading of the situation would have led Iran to conclude that as long as no U.S. military or diplomatic personnel were killed, the U.S. would hold its fire.

Killing Iran’s most important and influential military official was a clear and direct response by the U.S., and one designed not only to take Soleimani himself out of the equation permanently but to give Iran pause before ramping its attacks on U.S. interests and allies. In some ways, the strike was the ultimate manifestation of an argument that was frequently made by Trump supporters in the early days of his presidency, which was that his unpredictability would be a foreign policy asset. Iran was clearly taken by surprise by the Soleimani assassination and sees it as an extreme response to what precipitated it, and given the reporting that Trump ordered the strike more in a fit of pique than as a result of a carefully thought out strategy, there is a good chance that this episode does indeed restore a measure of deterrence that will prevent direct Iranian attacks on U.S. personnel and assets.

But that does not mean that this was the smartest or most effective way of going about things. Aside from the fact that killing Soleimani came about precisely because the U.S. had cast all deterrence aside by not reacting to repeated Iranian attacks and provocations in other ways, acting in such a high profile manner increases the risk that rather than be deterred, Iran will feel compelled to respond. It is not only the killing of such a high profile target, but the way in which the U.S. behaves in the aftermath that can drive a cycle of increasing escalation rather than de-escalation.

When Israel destroyed Syria’s nuclear reactor in 2007, it did so in a way designed to give the Syrians the cover to not respond. Israel took no public credit for the strike, did not call attention to it, did not crow about a momentous military and intelligence operation, and essentially behaved as if it knew nothing about what had taken place. The treatment of the operation solely as a national security objective rather than as a political or public relations achievement allowed Syria to deny that it had been attacked and to deny that it had been struck specifically by Israel, in turn mitigating any public outcry and pressure on the regime in Damascus to hit back at Israel. Similarly, until recent months Israel had been silent about its years-long bombing campaign consisting of hundreds of sorties against Iranian and Hizballah positions and weaponry in Syria. This has given space for Iran and Syria to both maintain a position of plausible ignorance and it has prevented an all-out war between Israel and Iran.

Rather than Trump triumphantly tweeting out an image of an American flag and the Pentagon issuing a statement immediately announcing its assassination of Soleimani, the U.S. should have issued a vanilla statement that Washington has no comment on any possible military operations in Iraq. The Iranians would have known precisely who was responsible and the harsh message would have been sent and received. By making a big deal of it and by following it up with bellicose tweets and absurd threats to destroy Iranian cultural sites, Trump made it harder for the Islamic Republic to respond in a way that would end this episode rather than create a tit-for-tat cycle.

With hundreds of thousands of Iranians in the streets for Soleimani’s funeral, creating pressure on the regime to respond expansively irrespective of what the Trump administration was doing and saying, the U.S. should have been downplaying its rhetoric and let the action speak for itself. While killing Soleimani is one aspect of establishing deterrence, taking into account Iranian domestic politics is another. The regime has been under pressure from all fronts due to U.S. sanctions and street protests by ordinary Iranians. There will undoubtedly be a rally around the flag effect – imagine how Americans of any political stripe would react to the killing of a Trump cabinet secretary or some other high-ranking official closely tied to Trump, no matter how they feel about the president himself. But leaving this aside, the last thing that the U.S. should want is for the Iranian regime to have to take into account voluminous and widespread calls demanding a large-scale response to the U.S. Even if regime leaders are shaken by the Soleimani killing and do not want war with the U.S., every country has domestic politics to contend with, including authoritarian ones. All Trump administration messaging has to take this into account, and understand that just as Trump seems to have been taunted by Iranian leaders into deciding to kill Soleimani, the U.S. should not make the same mistake by creating pressure on Iran’s leaders to do something rash.

Iran’s missile strikes against two airbases that were widely expected to be targeted appear to have ended without any American deaths. That is an encouraging initial development. It provides the space for this to end without things going any further, and may provide an initial clue that despite everything, the Soleimani operation accomplished its objective. The U.S. should absolutely expect further Iranian attempts to avenge Soleimani’s death, but they do not have to lead to a war between the two sides. If Trump can take some lessons from the Israelis and Teddy Roosevelt by speaking softly while carrying a big stick, then the Soleimani operation will end up looking more like the assassinations of Osama bin Laden and Abu Bakr al-Baghdadi and less like that of Archduke Franz Ferdinand.