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 news 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.