The killing of Qassem Soleimani in Baghdad on Friday generated a predictable and predictably partisan flurry of praise and condemnation. But the context in which the decision to kill him was made is being lost in angry rhetoric. We have to consider the context, however, both to evaluate the decision itself and, much more importantly, to understand where we are now.

The US and Iran have been locked in an escalation cycle throughout 2019. Iran reacted to the American withdrawal from the nuclear deal initially signed by President Obama in 2015 by reducing its compliance with the deal’s restrictions on its nuclear programs. Tehran’s leaders apparently hoped to persuade Europeans to break with the US, defy re-imposed American sanctions and resume full trade with and investment in Iran. The Europeans disappointed them.

The Islamic Republic then started using force to coerce America’s allies to abandon the US approach, attacking and seizing ships in the Persian Gulf in the summer. The US responded by imposing additional sanctions and by working with allies to provide military escorts for vulnerable vessels.

Unwilling to fight naval battles to seize ships, Iran instead shot down an American drone operating in international waters in the Persian Gulf. President Trump canceled a military response to that shoot-down because the Iranians had not killed anyone — just blown up an unmanned system. But he confirmed that he had canceled the strike as it was already getting underway.

Iran raised the stakes again in September by conducting a drone and missile attack against the Abqaiq oil facility in Saudi Arabia, briefly taking much of the Saudi oil supply off the market. The US responded with additional sanctions and deployed anti-missile systems and other forces to Saudi Arabia and the Persian Gulf, but launched no military response.

In the background of this regional confrontation, Iran was also moving to gain control of Iraq by causing its Iraqi proxies to infiltrate and manipulate the Iraqi government, security forces and political system. It looked for most of the summer as if this effort might well succeed. But the Iranian proxies overplayed their hand. Massive protests began in Iraq early in October against the many failures of the Iraqi government to provide for their people — and those protests rapidly focused on Iraqis’ anger at Iran’s excessive influence and interference in their country.

The Iranians responded by pushing and helping the Iraqi government to crack down on the protests with violence and censorship — which some in the Iraqi government were unfortunately all too willing to do. As Iranian proxies killed protesting Iraqis, they also began to target American facilities in Iraq with larger salvoes of rockets — but aimed to reduce the likelihood of killing American personnel. The US reacted by imposing additional sanctions against Iranians and especially against some of their most important proxies in Iraq.

Protests then exploded in Iran itself in November after the government announced an increase in the regulated price of gasoline. The protests quickly came to resemble those that rocked the country at the end of 2017 in size and scope, but the regime reacted much more quickly and with much greater brutality than ever before, prompting yet another round of American sanctions.

That is the background of the most recent series of escalatory steps. Iranian proxies fired a rocket volley at a base near Kirkuk City in Iraq, this time killing an American contractor and wounding several other Americans. The US retaliated with force for the first time, on Dec. 29 striking the bases of the proxy responsible for the attack in Iraq and Syria, killing two dozen militia members.

Two days later that proxy and others stormed the American embassy in Baghdad, causing extensive physical damage but no injuries. Then, late Thursday, the US killed Soleimani, who is the overall Iranian commander responsible for all of Iran’s clandestine and proxy activities, as well as the proxy’s commander, Abu Mehdi al Mohandis.

The US government has said it had evidence that Soleimani was in the midst of planning yet another attack against Americans in the region, and that is extremely likely. The entire pattern of US-Iranian interaction in 2019 has been characterized by consistent Iranian military and paramilitary escalation that the US has usually tried to stop with economic and defensive military deployments. Faced with the likelihood of yet another Iranian military attack, the decision to kill Soleimani and Mohandis was reasonable and defensible.

But it will have consequences, and we should focus more energy on how to handle them than we do on praise and recrimination for what is done.

The most immediate danger is that the Iraqi government will order US forces to leave Iraq. Such an order would very likely lead to the end of counter-ISIS operations in Iraq. It would probably also force the US to withdraw from Syria, since American forces there depend on bases in Iraq and have no alternatives in the face of Turkey’s hostility. The degradation or ending of operations in either country would be extremely dangerous because ISIS is, in fact, reconstituting in both places and has never lost the will to attack the US and the West.

Iran’s leaders and allies such as Lebanese Hezbollah could also launch a series of terrorist attacks in the West itself. Both Iranian and Hezbollah networks run throughout Europe and Latin America (where the Quds Force Soleimani commanded had conducted terrorist attacks before his tenure). American law enforcement broke up a money-laundering ring conducted on behalf of Hezbollah in the US in 2011. Last month, a Hezbollah militia member was sentenced to 40 years in prison for seeking out potential sites for terrorist attacks in New York City.

Iran could also choose to escalate further by attacking American bases in Bahrain or Qatar and the United Arab Emirates with missiles and/or drones, as senior Iranian military commanders had threatened to do even before the US strikes. It could attack American or other countries’ ships in the Persian Gulf. It could attempt to mine the Strait of Hormuz through which much of the Middle East’s oil passes.

The Trump administration is hedging against some of these risks by deploying additional US military forces to Kuwait, but it seems to be hoping that forcing Iran to pay the high price of losing one of its most senior, famous and popular military leaders will deter the regime from continuing to escalate militarily.

It is easy to point to all these risks and criticize the decision to kill Soleimani. We must recognize, however, that Iran might well have chosen to undertake these or other escalatory actions even if the US had done nothing or confined itself to statements, sanctions and defensive deployments. That, after all, has largely been the pattern of 2019.

The vital question before us is: Where are we now?

Killing Soleimani was an action, not a strategy. It will not destroy Iran’s ability to plan and conduct clandestine or overt military operations for long, even in Iraq.

The US must have a coherent plan moving forward that does not rely on sanctions and economic pressure alone, nor on one-off military strikes — but that also reduces the risk of full-scale regional war with Iran as much as possible, for no sane person can contemplate such a war with equanimity.

Developing such a plan is incredibly hard. Iran has been using force and even killing Americans for decades, and the US has rarely responded militarily. Establishing credible deterrence in the face of that track record will be very difficult.

Economic sanctions have put the regime under unprecedented pressure, but it has responded with more regional aggression and shown its willingness to crush its own people rather than change its policies. Sustaining economic sanctions for long enough to make the regime crack sounds appealing — but it requires convincing the Iranian leadership that they cannot escape the pressure by using force themselves, bringing us back to deterrence.

Could we end the tension and restore peace to the Middle East by rejoining the nuclear deal, as some advocate? No. That simple solution will not work either. Iran continued expanding its proxy networks throughout the region while the deal was in place, moving commanders, its own military forces and advanced weapons systems into Syria even while the US was abiding by the deal’s requirements. After all, the deal was never meant to constrain Iran’s regional activities — only its nuclear program.

In the current context, simply abandoning the current sanctions regime and rejoining the deal would look to Tehran like American surrender, and encourage Iran’s leaders to work even harder toward their constantly stated aim of expelling the US from the Middle East entirely.

We have to stop looking for simplistic solutions to one of the most complex problems we face in the world. We have to stop focusing our efforts on assigning blame either to Obama for joining the deal or to Trump for leaving it and force ourselves to wrestle with the realities facing us now. Only then do we stand a chance of building a policy that can achieve an end to this conflict at an acceptable cost and on terms we can live with.