President Trump’s public endorsement of torture, a crime under international and domestic law, is an extraordinary departure from American tradition that will have historic and far-reaching implications, experts told NBC News.

Trump said he believed "torture works" during the campaign, but on Wednesday he made his first detailed comments on the matter as president, having sworn to uphold the Constitution and the law. Asked by ABC News’ David Muir if he would say the U.S. doesn’t torture, Trump declined.

The president said he would defer to his foreign policy advisers about what interrogation techniques to use, and said he wants to do "everything within the bounds of what you're allowed to do legally."

But then, asked about his comments during the campaign that he supports "waterboarding and a hell of a lot worse," Trump said, "I would do, I would do — I want to keep our country safe." He added that if his advisers want to reinstate the simulated drowning technique known as waterboarding, "then I will work for that end [because] I think it works."

Trump’s remarks stunned even some of the architects of the CIA’s post 9/11 interrogation program.

"The whole premise of the original program was that the techniques did not fit the legal definition of torture," John Rizzo, who was acting CIA general counsel, said on MSNBC’s Andrea Mitchell Reports. Torture "was illegal then, and it’s illegal now… So to hear the President of the United States use that word in an affirmative way — I found that remarkable."

John Yoo, a former Justice Department lawyer who wrote some of the secret memos about the CIA program, told NBC News that Trump "is not being legally careful."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Rizzo, Yoo and their former colleagues, including President George W. Bush, argue that waterboarding, sleep deprivation, stress positions, confinement to small boxes and other techniques the CIA employed did not constitute illegal "torture," because of memos by Yoo and other Justice Department officials saying so.

Those memos have since been widely repudiated. The U.S. prosecuted Japanese war criminals after World War II who had inflicted something very much like waterboarding on American troops. A Senate report in 2014, though it didn’t use the word torture, made clear that the CIA techniques inflicted serious pain and suffering, to the point that some CIA officers openly wept as they watched them applied.

But at least the Bush administration felt the need to obtain legal opinions maintaining that it did not use torture.

Trump "has taken the veil off of this, as he has with so many things," said Karen Greenberg, director of the Center on National Security at Fordham University. "This is not a president who is going to pretend we’re going to do one thing and say another."

However, Greenberg said, his remarks show that he "is either not concerned about, or doesn’t understand, issues of recriminations and the blowback that can occur with such policies."

Torture is illegal under the framework of international law that the U.S. helped put in place after World War II. Specifically, the UN’s Universal Declaration of Human Rights. Article 5 states: "No one shall be subjected to torture or to cruel, inhuman or degrading treatment or punishment."

Torture is also illegal under American law, and that was the case long before Congress codified President Obama’s interrogation rules last year. Specifically, 18 USC Chapter 113C makes it a crime to commit torture outside of the United States. That law was enacted in 1994 to comply with international law. Domestic statutes have long made torture a crime.

"The world has taken torture and cruel, inhuman, and degrading treatment off the table, through binding international prohibitions that we have signed and ratified," said David Cole, national legal director of the American Civil Liberties Union. "The idea that the Trump administration is considering doubling down on these discredited policies is deeply disturbing."

Yoo offered a different view, arguing that a draft executive order that emerged Wednesday on detention and interrogation was rather modest. It called for studying whether to resume allowing the CIA to capture terrorists abroad and use enhanced techniques in interrogations.

"The broader political story is it’s putting our opponents on notice that they are not going to keep punching at us and nothing is going to happen back," Yoo said.

But Trump’s use of the word "torture," Rizzo said, would have far reaching international implications.

"The bad guys always claimed what we were doing was torture," he said. "Now they can claim to have the personal imprimatur of the President of the United States."

That is the "nightmare scenario for military leaders," said Eugene Fidell, a military law expert at Yale law school. "If we legitimatize something, the next thing you know somebody is going to do it to our troops."

Trump’s comments provoked an immediate response from some allies.

British Prime Minister Theresa May was asked about them by reporters on her plane as she flew to the U.S. to meet with Trump.

"We condemn torture and my view on that won't change — whether I am talking to you or talking to the president," she said, according to the BBC.

A White House spokesman told NBC News that President Trump will "follow the lead of [Defense] Secretary Mattis and [CIA] Director Pompeo on these matters and work within the law."

“Keeping America safe is President Trump’s top priority as commander-in-chief and it is a responsibility he takes with the utmost seriousness."