Mr. Comey later confirmed in testimony to Congress in June that he had told the president that he was not under investigation, but said he didn’t make that public because the status could change in the future.
Mr. Mueller is conducting a wide-ranging investigation into Russia and associates of Mr. Trump, including whether the president obstructed justice when he dismissed the F.B.I. director.
The Justice Department turned over a copy of the letter to Mr. Mueller in recent weeks.
Ty Cobb, a White House lawyer, declined to discuss the letter or its contents. “To the extent the special prosecutor is interested in these matters, we will be fully transparent with him,’’ he said.
Newsletter Sign Up
Get the Morning Briefing by Email
What you need to know to start your day, delivered to your inbox Monday through Friday.
Thank you for subscribing.
An error has occurred. Please try again later.
You are already subscribed to this email.
Mr. Miller drafted the letter at the urging of Mr. Trump during a weekend in May, when Mr. Trump and his team were at the president’s private golf club in Bedminster, N.J. During that same weekend, as Mr. Trump and a small group of aides were in Bedminster devising a rationale for Mr. Comey’s dismissal, Attorney General Jeff Sessions and Mr. Rosenstein were working on a parallel effort to fire Mr. Comey.
During testimony before the Senate Judiciary Committee in May, Mr. Comey gave the first detailed explanation for his handling of the investigation of Hillary Clinton, saying “it makes me mildly nauseous to think that we might have had some impact on the election.”
His conduct during the hearing added to concerns held by Mr. Sessions and Mr. Rosenstein that the F.B.I. director had botched the Clinton investigation and had overstepped the boundaries of his job.
Two days after Mr. Comey’s testimony, Mr. Rosenstein had a meeting with a White House lawyer at the Justice Department, where Mr. Rosenstein expressed concern about how the F.B.I. director had handled the Clinton investigation. The White House lawyer relayed the details of the conversation to his bosses at the White House.
Mr. Comey was fired on May 9.