The top nuclear commander in the US says he would resist any "illegal" presidential order to launch a strike.
Air Force Gen John Hyten, said as head of the US Strategic Command he provided advice to a president and expected that a legal alternative would be found.
His comments come just days after US senators discussed a president's authority to launch a nuclear attack.
Some of them expressed concern that President Donald Trump might irresponsibly order such a strike.
Others though said a president must have the authority to act without meddling from lawyers. It was the first such hearing in more than 40 years.
In August, Mr Trump vowed to unleash "fire and fury like the world has never seen" on North Korea if it threatened the US.
Last month, the Senate Foreign Relations Committee's Republican chairman, Senator Bob Corker, accused the president of setting the US "on a path to World War Three".
Speaking at the Halifax International Security Forum in Canada, Gen Hyten said: "We think about these things a lot. When you have this responsibility, how do you not think about it?"
As for the legality of a strike, the general said that he had studied US laws of armed conflict for many years which stipulates key criteria the president must consider before launching any attack:
- Unnecessary suffering
The armed conflict report quotes an International Court of Justice ruling which states that while the threat or use of nuclear weapons is not prohibited by international law, "the use of such weapons seems scarcely reconcilable with respect for the requirements of the law applicable in armed conflict".
While Senators and expert witnesses agree the president has full authority to defend the nation, commentators have pointed out that because there is no all-encompassing definition of "imminent attack", the president is not given an entirely free hand.
"I provide advice to the president, he will tell me what to do," Gen Hyten said.
"And if it's illegal, guess what's going to happen? I'm going to say: 'Mr President, that's illegal.' And guess what he's going to do? He's going to say, 'What would be legal?' And we'll come up with options, of a mix of capabilities to respond to whatever the situation is, and that's the way it works.
"It's not that complicated," Gen Hyten added.
He added: "If you execute an unlawful order, you will go to jail. You could go to jail for the rest of your life."
President Trump has not publicly commented on Gen Hyten's remarks.