THE FIRST results of the killing of Iranian Maj. Gen. Qasem Soleimani have not been positive for the United States. On Sunday, the Iraqi parliament voted to expel U.S. troops from the country. In Tehran, the regime of Ayatollah Ali Khamenei announced it would no longer observe controls on its uranium enrichment. Millions of Iranians, meanwhile, took to the streets to mourn Soleimani, providing the regime with a nationalist boost and setting the stage for likely acts of retaliation.

These consequences could be mitigated or even reversed, if President Trump and his administration act wisely. Yet Mr. Trump has so far done the reverse, issuing bombastic threats, hinting at a desire to commit war crimes and mocking congressional powers. If “deescalation” is actually the administration’s aim, as Secretary of State Mike Pompeo insists, then the president is actively thwarting it.

Tehran’s first reponses to the killing of its most powerful military figure appeared carefully tempered. In announcing it would enrich uranium without restriction, the regime said it could return to controls if U.S. sanctions were lifted. So far, it has not broken relations with the U.N. inspectors who monitor its nuclear activities, meaning that whatever it does will be subject to reporting.

Similarly, the vote by Iraq’s parliament on ejecting the 5,000 U.S. troops in the country was nonbinding, and Sunni and Kurd legislators who may oppose the withdrawal did not vote. Acting Prime Minister Adel Abdul Mahdi supports the measure, but he resigned from his post weeks ago and may not be able to implement it.

Preserving the U.S. position in Iraq will require skillful diplomacy. Yet Mr. Trump’s response to the parliamentary vote was to crudely threaten “very big sanctions” on Iraq if “they do anything we think is inappropriate.” That will only make it difficult for potential defenders of the U.S. deployment to resist what will surely be strong pressure from Iran to follow through on the expulsion.

Similarly, it ought to be a primary aim to coax the Khamenei regime toward diplomacy, rather than further escalation. Yet Mr. Trump is provocatively promising to target 52 sites inside Iran, including some “important . . . to Iranian culture,” in the event of any retaliatory attacks on Americans. When critics pointed out that strikes on cultural sites would be war crimes, the president doubled down. Meanwhile he informed Congress that his tweets would serve as notice under the War Powers Act that he would respond to any Iranian acts “perhaps in a disproportionate manner” — a claim that ought to make Republicans as well as Democrats bridle.

Mr. Trump may believe this bluster will deter Iranian action. It almost certainly won’t. But it may end up ensnaring the United States in the full-scale war with the Islamic republic that the president says he does not want. Iran, meanwhile, may return to the dangerous course of uranium enrichment that was restrained by the 2015 nuclear deal that Mr. Trump rashly discarded. If Iran succeeds in expelling the United States from Iraq, its strategic position in the Middle East will be stronger than ever.

The way to avoid these outcomes is to work with allies and other intermediaries to offer Iran a diplomatic solution, before the slide toward war becomes irreversible. In short, what’s needed is Mr. Pompeo’s “deescalation,” not Mr. Trump’s reckless threats.

Read more: