President Trump's newest legal adviser, former New York City Mayor Rudy Giuliani, shocked White House allies on Wednesday when he admitted in a televised appearance that President Trump reimbursed his personal attorney for the $130,000 payment he made to porn actress Stormy Daniels.

Giuliani's astonishing admission — that Trump "funneled" $35,000 payments to Michael Cohen through a law firm — came during an interview with Fox News' Sean Hannity, who himself seemed stunned by what the former federal prosecutor had to say.

"Oh. I didn’t know that," Hannity responded.

The interview carried on for several minutes, during which Giuliani revealed that Trump was familiar with "the general arrangement" between Cohen and Daniels, that the president paid Cohen back over a "period of several months," and that the money Daniels received did not come from the Trump campaign's coffers.

In subsequent interviews with several national media outlets, Giuliani said he was authorized by the president to deliver new "facts" about the Cohen case. "You won't see daylight between me and the president," he told CNN, noting that he offered no warning to Trump's communications team or other White House aides prior to appearing on Hannity's program.

"The president is my client. I don't talk to them," he said.

A source close to the White House told the Washington Examiner that several members of Trump's inner circle were "totally and completely left in the dark" and learned about Giuliani's comments either from Twitter or colleagues who had watched his appearance on "Hannity."

This person said they were walking to a bar with a former colleague who still works for the administration and overheard a stranger talking about Giuliani's comments while waiting to cross the street.

"I was like, 'Come again. He said what?" the source recalled.

White House press secretary Sarah Sanders told reporters at a press briefing Thursday afternoon that even she didn't learn about Trump's involvement until Giuliani's interview aired.

Outside of the White House, attorneys who have closely followed the special counsel investigation and Trump's legal troubles said they were baffled by Giuliani's strategy and concerned about the implications of his comments.

"I was flabbergasted by the interview — all the interviews," said Jonathan Turley, a constitutional law professor at George Washington University. "Giuliani may have tripped a number of additional wires for the president. No one could look at these interviews and consider them a success. It went spectacularly bad."

Turley pointed to the former mayor's comments about the origin of the $130,000 payment and whether it was intended to protect Trump's reputation at the height of the 2016 presidential election or save his marriage. Giuliani initially said Cohen made the payment, which he described as a loan that was later repaid, to protect Trump's marriage. But in a subsequent interview Thursday morning, he appeared to contradict himself by tying the payment to the outcome of the election.

"Imagine if that came out on Oct. 15, 2016, in the middle of the last debate with Hillary Clinton," he told "Fox & Friends," adding that Cohen "made it go away."

Federal election laws require the disclosure of all campaign-related contributions or loans, raising questions about whether Cohen's payment to Daniels 11 days before the Nov. 8 election was meant to help Trump in his race against Democrat Hillary Clinton.

"Converting this from a gift to a loan doesn't change the potential violation," Turley said. "If a prosecutor believes that this money was paid to help elect Donald Trump, it falls within the type of Edwards interpretation from a decade ago. What Giuliani said was not done particularly well."

Turley was referring to 2004 Democratic vice presidential nominee John Edwards, who was indicted in 2011 on charges of using nearly $1 million in campaign funds to hide a mistress and love child from voters during his 2008 bid for the White House. A North Carolina jury convicted him on one count, but deadlocked on five others, leading a federal judge to declare a mistrial.

Another attorney, who requested anonymity because of his ties to Trump lawyer Jay Sekulow, said Giuliani's comments were even worse because they appeared to contradict a comment Trump made to reporters in early April about Cohen's payment to Daniels.

Asked aboard Air Force One whether he knew about the payment to Daniels, Trump tersely responded: "No."

"You'll have to ask Michael Cohen. Michael is my attorney. You'll have to ask Michael," the president added.

"I don't know how you reconcile the two," the attorney said, referring to Trump's and Giuliani's separate comments about the president's awareness of the payment.

But Turley cautioned against suggestions that Trump "lied" during his conversation with reporters on April 6, claiming the president's statement might be "finessed" in such a way that he avoid greater legal scrutiny.

"The statement on Air Force One should not be overblown. [Trump] has some heavy lifting to do with regard to his prior statements, but that one can certainly be finessed to say he was thinking about a more narrow question," Turley said, adding that Trump "could be subject to a judgment from people as to the common-sense meaning of the question and his answer."

He continued, "In the criminal court of law, it's as important where someone lies as whether they lie. I testified at the Clinton impeachment as one of the experts and I said, 'President Clinton cannot be impeached for lying about an affair, but he also cannot believe he has the liberty of lying under oath.'"

"So Trump can still put forward a viable defense," Turley said. "But the great danger, of course, is that he would make a false statement under oath."