President Trump and officials in his administration have put forward shifting explanations to justify the strike on Iranian Maj. Gen. Qasem Soleimani, most involving unsupported claims that he had been planning “imminent” attacks. Trump recently asserted Soleimani was targeting four U.S. embassies, a claim Secretary of Defense Mark T. Esper declined to defend. Rep. Justin Amash (I-Mich.) went so far as to say the claim about the embassies “seems to be totally made up.” On Monday, Trump tweeted affirmation that Soleimani posed an imminent threat but also said the question “doesn’t really matter because of his horrible past.”

In fact, the question of imminence is crucial under both domestic and international law. Under the U.N. Charter, the president’s authority to kill Soleimani required that the United States was facing an armed attack — as well as that the use of force was necessary to repel or prevent it. The United States has long understood that doctrine to also permit force necessary to stop an imminent attack. Whether an attack was truly imminent is also key to the domestic legal question, because U.S. law does not permit the president to use force unilaterally (that is, without congressional authorization) outside of the most exigent circumstances. These legal questions are no mere technicalities. The purpose behind the law is to limit unnecessary war to the greatest possible extent. U.S. presidents have at times pushed the limits of such laws, but doing so has dire consequences — including unnecessary conflict, civilian casualties and the lost trust of our allies, as well as of the U.S. public.

To be sure, neither the U.S. Constitution nor the U.N. Charter says anything explicitly about “imminent” attacks. But as a matter of international law, the charter and customary international law both prohibit the use of force against another state, with a handful of exceptions: The U.N. Security Council may authorize force, for example, or a state may consent to the use of force in its territory. Neither applied in the Soleimani strike, which occurred on Iraq’s territory against its wishes. The only exception that could conceivably apply here would be the one Trump says “doesn’t really matter”: self-defense that is necessary and proportionate to repel an armed attack.

Here is where “imminence” comes in. Most experts accept that the self-defense exception also includes defense necessary to prevent an “imminent” armed attack, though what makes an attack sufficiently close at hand is a matter of substantial debate. The concept traces back to the “Caroline incident” of 1837, in which Canadian militia destroyed a U.S. vessel by that name deemed a threat. In the aftermath, the United States argued the attack could be justified only if it was in response to a threat that was “instant, overwhelming, leaving … no moment for deliberation” — which was disputed in the Caroline incident. In recent years, the United States has courted significant controversy by stretching the concept of imminence, most recently under the Obama administration, which put forth a test of imminence that included several factors, including “the nature and immediacy of the threat; the probability of an attack; [and] whether the anticipated attack is part of a concerted pattern of continuing armed activity.” But under no plausible interpretation of international law can a state claim self-defense when it is neither responding to an armed attack nor anticipating one.

Some legal scholars have suggested a more justifiable characterization for the U.S. actions here may be as a response to past Iranian military attacks, not an imminent one. And in a letter to the United Nations defending the attack, U.S. Ambassador Kelly Craft suggested that Iran’s past actions justify the U.S. strike. “Over the past several months, the United States has been the target of a series of escalating threats and armed attacks by the Islamic Republic of Iran,” she wrote — including the shooting down of a U.S. drone in June, and a “series of attacks” by “Qods Force-backed” militias. Even were each of the acts listed in the letter both attributable to Iran and properly characterized as armed attacks — a stretch for various reasons, including that the U.S. drone was itself unmanned and that Iran claimed it shot it down in Iranian airspace — the use of force in response must still be necessary to stop an ongoing attack or prevent one. Soleimani’s history, and Iran’s, provide context for analyzing the nature of any current threat. But the use of force as retaliation or punishment for a past wrong is strictly prohibited under international law; the narrow exceptions the charter permits do not include revenge. So we are back to the original question: whether Soleimani posed an immediate threat for which the use of force was necessary.

Finally, even were an attack against Iran itself justified, the fact that the Soleimani strike took place in Iraq makes the question of imminence even more important. Iraq, of course, did not itself attack us. A crucial step in determining whether it is necessary to use force on the territory of a state that did not itself attack us — the long-standing U.S. approach, dating to the Caroline incident, increasingly adopted by other states — has been to, first, establish the imminence of a forthcoming attack and then to analyze whether that state is itself unwilling or unable to prevent or stop the attack. The administration has not put forward evidence on either question — and has not even addressed the issue of Iraqi sovereignty.

There are good reasons for these rules. Any use of force that is not “necessary” as a matter of self-defense, but is intended merely as retaliation, risks escalating conflict for a purpose that may seem momentarily satisfying, but is ultimately ruinous. States enshrined the prohibition on force and its narrow exceptions by treaty in the U.N. Charter after the brutal wars in the first half of the 20th century. It continues to be in the U.S. interest, including our national security interest, to continue to respect these rules. Our ability to receive and share intelligence, use military bases and airfields abroad, coordinate military endeavors, impose sanctions — all of this depends on our allies believing that they can trust our justifications and depend on us to act within the limits of shared norms.

These questions of imminence and necessity are also critical in domestic law: They speak to the question of whether the president had authority to act under the U.S. Constitution. The Constitution, of course, gives Congress, not the president, the power to declare war. Most experts agree the president has some power to defend the nation against a truly immediate threat, one where there is no opportunity for him to go to Congress to seek approval. But even in such dire circumstances, the expectation is that the president will seek approval as soon as is practicable. Congress recognized this understanding in the War Powers Resolution, a 1973 statute, which accepts that the president may act unilaterally in the face of an attack creating a “national emergency” but requires prior consultation with Congress “in every possible instance.”

The framers gave Congress, not the president, the power to declare war with the understanding that it would slow the rush into conflict. A narrow exception for circumstances in which there is truly no time to go to Congress for a vote makes sense. But the president cannot circumvent Congress simply because he views it as good policy to take action. Reports suggest some U.S. officials, including Gina Haspel, the CIA director, argued that this use of force would, in the long run, make the nation safer. And they were welcome to take that argument to Congress. Absent a truly exigent threat, it is not the president’s call to make.

Some commentators have quite rightfully pointed out that whatever the formal constitutional allocation of legal authorities, presidents have over time aggressively interpreted their power to act unilaterally, and Congress has largely let them. The upshot is that, as a practical matter, the power to wage war now largely lies with the president. Nevertheless, Congress has many tools at its disposal to reassert its powers, even if it has failed to do so in recent years. Members of Congress can demand that a president provide a legal justification and concrete evidence for any strike, and they can alert the public if they deem the evidence insufficient. (Several, including Sen. Mike Lee (R-Utah), raised strong objections to the administration’s justification for the strike after the White House briefed Congress.) Congress can vote up or down on war powers authorizations and restrict funds for particular uses of military force. Finally, as I have written elsewhere, Congress has tools to manage decision-making within the executive branch itself. Congress can demand that current officials testify about the situation in Iran, that key offices inside the government be included in decision-making processes and that specific officials personally certify that certain evidence exists before force is used. It can insist that critical offices cannot operate for long without a Senate-confirmed leader and that officials seeking confirmation promise not to use force without congressional consultation and authorization.

Ultimately, however, Congress and others outside the executive branch can do only so much to rein in a president who is determined to stretch the bounds of his or her power. The president has immediate control over the military. And while military officers and others in the chain of command may question or push back on his proposals, they will follow his orders (short of clear war crimes and other patently illegal acts). The most significant check on a president who has little inherent interest in law or norms is a political one. Elections matter. Law can constrain the president, but only if we care, sufficiently and in sufficient numbers, when he violates it.