President Donald Trump’s apocalyptic admonishment to North Korea over its nuclear threats to annihilate the United States suggested that he may be closer than ever to ordering an attack — without waiting for North Korea’s Kim Jong Un to strike first.

Trump’s supporters have said that such a strike, should there be one, would be legally justified as an act of self-defense by the United States against a dangerous and irrational adversary. Others disagree, and many scholars of international law say the legal issues surrounding attacks in self-defense are complicated and subject to interpretation.

Asked about the possibility of a first strike on Thursday, Trump said, “We don’t talk about that. … We’ll see.”

The self-defense argument for such an attack is generally not recognized as valid. But there are situations in which a first strike can be interpreted as legally justified.

Michael Schmitt, a professor at the U.S. Naval War College, said three basic requirements must be met: The other country must have the ability to attack, its behavior must show that an attack is imminent, and there are no other ways to forestall it.

North Korea’s military power appears to have satisfied the first requirement. But under the second, “we have to determine whether the statements by Kim are bluster or he actually intends to carry them out,” Schmitt said. Under the third requirement, he said, “you can only act in self-defense when if you don’t act, it’s going to be too late.”

While North Korea may have an ability to attack the U.S., there is skepticism that an attack is imminent. And many officials, including some of Trump’s senior aides, have said other options have not been exhausted.

“I think that the answer to the question is fairly unequivocally ‘no,’ ” said Kevin Jon Heller, a law professor at the University of London. “There’s no right of self-defense against a nonimminent threat.”

Legal experts said an attack of self-defense in such circumstances must be “proportional” — meaning it is designed only to stop the threat. “It is not a carte blanche to destroy another country,” Schmitt said.

North Korea has a well-established penchant for making threats without following through on them.

“Kim says all kinds of crazy things, with no history besides incendiary statements,” said Anthony Clark Arend, a professor of foreign service at Georgetown University.

At least some of the military planning for an attack by North Korea, including troop movements and missile launch preparations, would almost certainly be detected.

“If North Korea were preparing for an attack, you’d see it,” Arend said.

It’s a matter of debate whether the United Nations charter permits one state to attack another before it is attacked. Article 2 of the charter prohibits states from using or threatening force against one another, while Article 51 does not prohibit the “inherent right of individual or collective self-defense.”

But Article 51 has been interpreted in different ways. Under the restrictive interpretation, an attack must happen before the attacked state can use force. Less restrictive interpretations argue that a state threatened by attack does not need to wait.

What defines an imminent attack? That is also a matter of debate. In the 1967 Arab-Israeli war, when Israeli commanders ordered an attack after Egyptian forces massed on the border, “many people thought it was reasonable for Israel to conclude an attack was imminent,” said Ashley Deeks, a University of Virginia School of Law professor.

When Israeli jets destroyed an atomic reactor in Iraq in 1981, Israel was condemned in a unanimous Security Council resolution. Many said that the imminent threat standard had not been met.

What constitutes imminence has been muddied by terrorists, cyberattacks and other more nebulous threats. “Allies … agree that the idea of imminence can’t just mean right as a weapon is lifting off the launchpad,” Deeks said.

Most scholars say legality for a pre-attack strike was an established after what is known as the Caroline incident of 1837, named for an American steamship suspected of supplying Canadian rebels against British rule. The ship was boarded by British soldiers who killed several Americans, set it ablaze and sent it over Niagara Falls. The British claimed they were acting in self-defense, an argument angrily rejected by Secretary of State Daniel Webster.

The matter was settled with an agreement on the conditions constituting legitimate self-defense in anticipation of an attack. As Webster described it, a state must demonstrate that the “necessity of that self-defense is instant, overwhelming and leaving no choice of means and no moment for deliberation.”