The story of a 2016 payment from President Trump’s personal attorney to a pornographic film actress took another dramatic turn on Tuesday when the attorney, Michael D. Cohen, said in court that he made the $130,000 payment “at the direction” of Mr. Trump. Mr. Cohen pleaded guilty to campaign finance violations related to the payment.

Mr. Cohen’s account contradicted his own earlier statements about the payment, as well as those made by the president and other advisers. Those explanations have ranged from outright denial of the president’s involvement to suggesting that Mr. Trump reimbursed Mr. Cohen but had no earlier knowledge of the payment. Related article »

“President Trump once again vehemently denies any such occurrence.”

In an email sent to The New York Times after The Wall Street Journal reported about the payment, Mr. Cohen, the president’s longtime personal lawyer, did not address the payment but denied that Stephanie Clifford, better known as Stormy Daniels, and Mr. Trump had had an affair.

“It’s old news that wasn’t true then and not true now.”

After In Touch magazine published excerpts from a 2011 interview with Ms. Clifford in which she said she had a sexual relationship with Mr. Trump, Mr. Cohen again denied that such a relationship existed. “This is not breaking news,” he said in an email to The New York Times.

“I used my own personal funds to facilitate a payment of $130,000 to Ms. Stephanie Clifford.”

In a statement to The New York Times, Mr. Cohen acknowledged for the first time that he had a role in the payment, adding, “Neither the Trump Organization nor the Trump campaign was a party to the transaction with Ms. Clifford, and neither reimbursed me for the payment, either directly or indirectly.”

“There was no knowledge of any payments from the president.”

“I’ve had conversations with the president about this,” said Ms. Sanders, the White House press secretary. “He has denied all these allegations.”

“No.”

This was Mr. Trump’s response when he was asked by a reporter if he knew about the payment to Ms. Clifford. In what were his first public remarks about the matter, Mr. Trump denied knowing about the $130,000 payment. He added, “You’ll have to ask Michael Cohen.”

“He represents me, like with this crazy Stormy Daniels deal, he represented me.”

In a telephone call to “Fox & Friends,” Mr. Trump distanced himself from Mr. Cohen but acknowledged that Mr. Cohen represented him in connection with Ms. Clifford.

“The president repaid it.”

Mr. Giuliani, one of the president’s lawyers, told Sean Hannity, the Fox News host, that Mr. Trump reimbursed Mr. Cohen for the payment. Mr. Giuliani also referred to the payment as a “retainer.” The statement contradicted what Mr. Cohen said about using his own money to pay Ms. Clifford. It also contradicted Mr. Trump’s statement that he was not aware of the payment.

“They set up a reimbursement, $35,000 a month.”

In an interview with The New York Times shortly after his Fox News appearance, Mr. Giuliani said that over all, Mr. Cohen was paid $460,000 or $470,000 out of Mr. Trump’s “personal family account” after the campaign was over. He did not use the word “retainer” in relation to these payments, which he said also included money for “incidental expenses” that Mr. Cohen had incurred on Mr. Trump’s behalf.

“Mr. Cohen, an attorney, received a monthly retainer.”

In a series of Twitter posts, Mr. Trump confirmed he made the payments to Mr. Cohen. He said the money for Ms. Clifford was paid out of a retainer, which appeared to contradict Mr. Giuliani’s initial description of a monthly reimbursement plan out of his personal family account. Over all, however, Mr. Trump seemed to be backing up Mr. Giuliani.

“Having nothing to do with the campaign.”

The president also said that the money was in no way related to the campaign. “Money from the campaign, or campaign contributions, played no” role in the transaction, Mr. Trump tweeted.

“Imagine if that came out on Oct. 15, 2016, in the middle of the, you know, last debate with Hillary Clinton.”

Mr. Giuliani, in an early morning interview with “Fox & Friends,” seemed to speculate over what would have happened if allegations of the affair resurfaced during the campaign. He appeared to suggest that timing of the payment was connected to the contentious presidential election, contradicting Mr. Trump’s Twitter statements, as well as his own. Mr. Giuliani said Mr. Cohen was just doing his job by making it “go away.”

“Virtually everything said has been said incorrectly.”

The president undercut Mr. Giuliani’s statements about the payment, saying the former New York City mayor is still “learning the subject matter” and will “get his facts straight.” He said Mr. Giuliani would be issuing a statement.

“There is no campaign violation.”

In his statement, Mr. Giuliani merely reiterated that Mr. Trump’s payment to Mr. Cohen was not a campaign violation and added that “references to timing were not describing my understanding of the president’s knowledge, but instead, my understanding of these matters.”

“At the direction of the candidate.”