The answer depends largely on facts that aren't publicly known yet. And experts are quick to point out that even if it was legally justified that doesn't make it the right decision, or one that will be politically smart in the long run. Iran and its allies are vowing revenge.
In its limited explanation so far, the Pentagon said Gen. Qassem Soleimani was "actively developing" plans to kill American diplomats and service members when he was killed in a U.S. drone strike Friday near the Baghdad airport shortly after arriving in the country.
That would appear to place the action within the legal authority of the president, as commander in chief, to use force in defense of the nation under Article II of the Constitution, said Bobby Chesney, a professor at the University of Texas School of Law who specializes in national security issues.
"If the facts are as the Defense Department said, then the president relatively clearly has Article II authority to act in self-defense of American lives," Chesney said.
That justification would apply even if Soleimani hadn't already launched an attack under the established doctrine of "anticipatory" self-defense, according to Jeff Addicot, a retired Army officer and expert in national security law at St. Mary's University School of Law in San Antonio.
"Legally there's no issue," Addicot said. "Politically, however, it's going to be debated, whether it's the correct response. In my opinion it's the appropriate response, but it's certainly legal."
Self-defense would be a legal justification under both U.S. law and the laws of international armed conflict, though the experts consulted by The Associated Press repeatedly stressed that this would depend on what intelligence prompted the killing, and American authorities may never release that information.
"Under international law, self-defense, to be lawful, will need to be invoked in situations where there is an imminent attack against the interest of the territory, in this case of the United States," said Agnès Callamard, United Nations special rapporteur on extrajudicial executions. "At this point in time, the United States has not thus far provided any information suggesting that there was an imminent attack against the American interest."
Secretary of State Mike Pompeo said the general posed an "imminent" threat. "He was actively plotting in the region to take actions — a big action, as he described it – that would have put dozens if not hundreds of American lives at risk," he told CNN.
The U.S. has used such justification in the past. In April 1986, President Ronald Reagan launched strikes against Libya based on what he said was "solid evidence" of attacks planned by longtime dictator Moammar Gadhafi against U.S. installations, diplomats and American tourists. The attack, which the president said was "carefully targeted to minimize casualties" among civilians, killed about 40 people but not the Libyan leader.
One problem with relying on the self-defense rationale is that the justification is undermined if the risk of retaliation would create more of a threat to Americans, said David Glazier of Loyola Law School in Los Angeles. "This is an incredibly complex question," he said. "I'd be very wary of anyone who says they know the answer."
There are separate but related legal questions about other aspects of the attack that Iran state TV said killed a total of 10 people, including a deputy commander, five Revolutionary Guard members and Soleimani's son-in-law. Among them: Was this a legitimate military target? Yes, since the general was a military and not a civilian figure, according to experts.
Soleimani, the head of Iran's elite Quds Force, oversaw foreign operations that U.S. officials say have killed hundreds of American troops.
Callamard said the deaths of civilians make this potentially an "arbitrary killing" under international human rights law. But U.S. experts said so-called collateral deaths have long been an unfortunate fact of war and whether this would amount to a war crime would depend on factors such as how many of the people killed could be considered legitimate targets in a conflict.
Democratic leaders of Congress complained they weren't notified of the strike in advance. Chesney said the administration could argue it has legal authority to protect the troops in the Middle East who were dispatched under congressional authorizations in 2001 and 2002 in the wake of the Sept. 11, 2001, terrorist attacks.
That argument, however, starts to get shakier if the killing of Soleimani escalates into a wider conflict, said Stephen Vladeck, a professor at the University of Texas School of Law who specializes in national security law and the prosecution of war crimes.
"Even though the Executive Branch has pursued ever-broader theories of the President's unilateral power to use force in self-defense, one of the critical considerations in each case has been whether the force comes with a risk of escalation," Vladeck said by email. "Where, as here, there is no question that it does, the argument that the President needed clearer buy-in from the legislature is much, much stronger."
House Intelligence Committee Chairman Adam Schiff said the world is "better off" without Soleimani. But after receiving a classified briefing on the intelligence that led to the strike he questioned the timing and expressed concern about what might happen next.
"Sulemani has been engaged in deadly and malevolent action throughout the region for a long time," Schiff said. "And the question is why the administration chose this moment, why this administration made the decision to remove him from the battlefield and other administrations, both parties, decided that would escalate the risks, not reduce them."