Mr. Cohen has told the associates that last March, before his office and homes were raided, he had dinner with Mr. Trump, and that he and the president talked on the phone after the raids in April. After those conversations, Mr. Cohen told the associates that he anticipated he would be given a pardon or some form of protection if he would remain silent about having been reimbursed by Mr. Trump for making the payments, according to people told of the discussions.

Mr. Cohen and Mr. Trump were part of a formal agreement in which their lawyers worked together to review documents that the F.B.I. had seized to determine what could be declared off limits to law enforcement officials because of attorney-client privilege. But that joint effort ended in July 2018, as Mr. Trump’s aides balked at paying parts of Mr. Cohen’s legal bills.

The exchange between the two men on Friday highlighted the stakes for both in establishing whether Mr. Cohen was credible in the accusations he has made against the president in his congressional testimony and in providing information to federal prosecutors. Republicans and Mr. Trump’s allies have noted that in the testimony he said he had never sought a pardon. At the same time, Mr. Trump has often said things that are not true, including statements related to his knowledge of the payments to Ms. Daniels.

The questions about the credibility of Mr. Cohen’s public testimony stands in contrast with how some prosecutors working with him have described him. A memo to the federal court judge overseeing Mr. Cohen’s case in Manhattan from the office of the special counsel, Robert S. Mueller III, said that Mr. Cohen had been truthful and provided useful information in connection with their work. Federal prosecutors in Manhattan were more questioning about the timing and motivation for Mr. Cohen’s help, but they also have used information he provided that they were able to corroborate.

The volleys between the two men on Friday also highlighted the continued questions about Mr. Trump’s pardon power and how he might use it as Mr. Mueller wraps up his investigation, as other federal prosecutors and Democrats in Congress intensify theirs and expand their scope into the president’s business career.

The New York Times reported in March 2018 that Mr. Trump’s previous lead lawyer, John Dowd, had raised the possibility of pardons with lawyers for Paul Manafort, the president’s former campaign chairman, and Michael T. Flynn, the former national security adviser, after they had been charged in cases brought by Mr. Mueller’s team.

Mr. Trump was asked Friday about the possibility of a pardon for Mr. Manafort. Mr. Manafort was sentenced to 47 months in prison on Thursday in one of two cases brought against him by Mr. Mueller’s prosecutors.