Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Donald Trump only recently found out that he had reimbursed his personal attorney, Michael Cohen, for a $130,000 nondisclosure agreement with adult performer Stormy Daniels just days before the 2016 election, his lawyer Rudy Giuliani claimed Thursday.

In a telephone interview with NBC News, Giuliani insisted he only shared details of the payment with Trump about a week ago.

“I don't think the president realized he paid him (Cohen) back for that specific thing until we (his legal team) made him aware of the paperwork,” he said.

Giuliani said the president responded, "Oh my goodness, I guess that's what it was for.”

Giuliani says the president was subsequently on board with the decision to go public with the reimbursement. "You're not going to see daylight between the president and me," he said. "We're going to work hard to have a consistent strategy."

Giuliani, a former New York mayor and U.S. attorney, joined Trump's outside-the-White-House legal team last month. He caused a sensation Wednesday night when he said on Fox News' "Hannity" that the president had indeed reimbursed Cohen for paying Daniels.

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

Previously, Trump denied covering the cost of the agreement. Cohen had said he took a home equity credit line to cover the payment to Daniels.

When asked how many payments Trump had made, Giuliani told NBC News the president started paying Cohen back in January 2017 and that altogether there were “about 12 installments of $35,000 each.”

The money, totaling an estimated $420,000, also covered other expenses and fees for Cohen, Giuliani said, but he was unable to provide details.

MSNBC contributor Donny Deutsch, however, said Cohen told him late Thursday night that Giuliani "doesn't know what he's talking about," regarding the president's repayment of the Daniels hush money.

NEWS: In a conversation last night with @DonnyDeustch, Trump attorney Michael Cohen says "Rudy Giuliani doesn't know what he's talking about" regarding the President's repayment of the Stormy Daniels hush money. — Willie Geist (@WillieGeist) May 4, 2018

The payment raised eyebrows because neither Cohen's original outlay to Daniels, who has claimed she had sex with Trump and was paid to be quiet, nor Trump's repayment were reported to the Federal Elections Commission as contributions to a campaign that could have benefited from the performer's silence.

Giuliani told Sean Hannity it would have been politically problematic for news of the deal to break in the month before the election.

On Thursday morning he returned to Fox News and repeated the sentiment that if Daniels hadn't been paid days before the election, a public revelation from her could have turned the presidential race upside down.

"Imagine if that came out on Oct. 15, 2016, in the middle of the last debate with Hillary Clinton,” Giuliani said on "Fox and Friends," referring to Daniels' claim she had a one-night stand with Trump in 2006. Cohen and Trump aides have denied any affair.

But in his interview with NBC News Thursday night, Giuliani denied that his remarks amounted to an admission that the payment was a campaign contribution and argued the payment had nothing to do with the campaign.

“If there was no campaign, Cohen would have made the same payment in the same amount to prevent personal embarrassment and heartache to his wife," Giuliani said.

Giuliani repeated that candidate Trump wasn’t aware of the payment in October 2016 and said, “Cohen thought he was doing it to help alleviate a personal problem.”

In April investigators armed with search warrants raided Cohen's offices, hotel room and home as part of an investigation into his business dealings by the U.S. attorney in New York. Focus has turned to Cohen's close relationship with the president and what he knows about Trump's relationship with Russia.

When asked if part of Trump's legal strategy was to make sure Cohen doesn’t flip on the president, Giuliani responded: “No I don't think he's going to flip. There is nothing for him to flip over.”