In the days after the F.B.I. director James B. Comey was fired last year, the deputy attorney general, Rod J. Rosenstein, repeatedly expressed anger about how the White House used him to rationalize the firing, saying the experience damaged his reputation, according to four people familiar with his outbursts.

In public, Mr. Rosenstein has shown no hint that he had second thoughts about his role — writing a memo about Mr. Comey’s performance that the White House used to justify firing him. “I wrote it. I believe it. I stand by it,” Mr. Rosenstein said to Congress last year.

But in meetings with law enforcement officials in the chaotic days immediately after Mr. Comey’s dismissal, and in subsequent conversations with colleagues and friends, Mr. Rosenstein appeared conflicted, according to the four people.

He alternately defended his involvement, expressed remorse at the tumult it unleashed, said the White House had manipulated him, fumed how the media had portrayed the events and said the full story would vindicate him, said the people, who in recent weeks described the previously undisclosed episodes.