A spokeswoman for the Justice Department, Sarah Isgur Flores, disputed the accounts of Mr. Rosenstein’s behavior. If he was angry in the days after Mr. Comey was fired, she said, it was because Mr. McCabe concealed from him the existence of memos by Mr. Comey about his interactions with Mr. Trump. Detailing the president’s requests for loyalty and to end the investigation into Michael T. Flynn, then his national security adviser, the memos were recounted in articles in The New York Times around that time.

“To be clear, he was upset not because knowledge of the existence of the memos would have changed the D.A.G.’s decision regarding Mr. Comey, but that Mr. McCabe chose not to tell him about their existence until only hours before someone shared them with The New York Times,” Ms. Flores said.

A person close to Mr. McCabe disputed Ms. Flores’s account, saying Mr. Rosenstein did not bring up the memos with him. Their discussion came at the conclusion of a larger meeting of law enforcement officials, and Mr. McCabe recounted it to colleagues. He also documented some of his interactions with Mr. Rosenstein in contemporaneous memos that have been handed over to the special counsel, according to two people briefed on the matter.

In the months since, Mr. Rosenstein has reached out to people — including in late-night texts — to discuss how his reputation has fared and his frustrations with the White House and members of Congress who have targeted him, according to people who spoke to him.

A graduate of Harvard Law School, Mr. Rosenstein joined the Justice Department in 1990. A Republican, he was nominated in 2005 by President George W. Bush to be United States attorney in Maryland and was the longest-serving United States attorney until Mr. Trump appointed him deputy attorney general last year.