President Trump on Wednesday was right to take a win and show restraint by avoiding a major military response to what he correctly recognized as a face-saving action by Iran. Trump dealt a devastating blow to Iran by killing its terrorist leader, Qassem Soleimani, without absorbing any U.S. casualties.

When Soleimani was killed, there was no doubt, even among analysts opposed to Trump, that it was a significant setback for the Iranian regime. Soleimani was one of the most important figures in Iran — both the architect and contractor of its regional strategy to extend the regime's influence from Tehran to the Mediterranean Sea. He directed global terrorist attacks, targeted U.S. troops in Iraq, aided Bashar Assad in the slaughter of hundreds of thousands of his own people, supported the terrorist group Hezbollah, and fueled the civil war in Yemen by supporting the radical Houthi movement. Simply put, he was irreplaceable.

But critics of the targeted killing argued that Trump’s action was a major escalation that would prompt a massive response from Iran. In often hyperbolic tones, they described the attack as Trump effectively launching a massive, bloody war. "World War III" was trending on Twitter.

In reality, Trump’s thinking was the opposite of what his critics suggested. In the run-up to the attack on Soleimani, Shiite militias under the general's ultimate direction were firing rockets at U.S. troops, and Iran had orchestrated an attack on the U.S. Embassy in Baghdad. This came on top of months of broader escalation, including the targeting of drones and tankers in the Arabian Sea and attacks on Saudi oil fields. It was necessary for Trump to do something significant to reestablish deterrence against Iran. Killing Soleimani was a way to weaken Iran severely and reestablish deterrence in a targeted way, without a massive military engagement.

The only question was whether the killing of Soleimani would provoke a furious response that made it impossible for Trump to avoid further action. Yet what Iran did was launch missiles into bases in Iraq that did not create any American casualties. This was likely not an accident. If Iran wanted to cause a large number of U.S. casualties, other targets could have achieved that purpose. But Iran chose to attack bases where the United States was prepared for any attack and able to protect its personnel.

It is, of course, possible that this is not the extent of Iran’s military response. And its terrorist proxies could respond in more indirect ways over time. But there are a number of reasons to believe that this was the regime’s big action, undertaken with a major public relations effort for domestic consumption. The operation was named after “Martyr Soleimani,” and Iran’s propaganda outlets claimed massive U.S. casualties and published photos of old Iranian attacks to make the action seem bigger than it was.

After days of tough talk and chants of "death to America," Iranian officials are now claiming that they have no interest in further escalation if the U.S. does not retaliate. Also, Iran tellingly claimed that in the event of any U.S. response, it would react by attacking Israel and Dubai — another signal that it was not willing to test Trump seriously by engaging Americans. The military action follows days of face-saving measures, such as the symbolic vote by the Iraqi Parliament opposing the U.S. troop presence. Not only was the vote nonbinding, but it was also conducted by only a fraction of the Parliament that was friendly to Iran.

Of course, casualties or not, the decision by Iran to launch more than a dozen ballistic missiles toward American troops directly and not through proxies, could not be totally shrugged off. Nor can its belligerence be totally ignored. So that’s why it was also the right call for Trump to announce that he would be adding an additional layer of economic sanctions on top of those already reimposed after he left the nuclear deal. Trump was correct to reiterate that the U.S. is still prepared to confront Iran, to apply “maximum pressure,” and to prevent the world’s largest state sponsor of terrorism from becoming a nuclear power, while at the same time, leaving the door open for peace should Iran change its tune.

Trump’s foreign policy positions have been criticized as incoherent. But his recent actions on Iran are the most consistent manifestation yet of his foreign policy impulse to project strength while avoiding protracted wars.