Special counsel Robert S. Mueller III is reviewing a letter drafted by President Donald Trump and a top aide in the days before the firing of FBI Director James Comey laying out in detail why the president wanted to get rid of the country’s top law enforcement official, according to people familiar with the Mueller probe.

The multi-page letter enumerated Trump’s long-simmering complaints with Comey, according to people familiar with it, including Trump’s frustration that Comey was unwilling to say publicly that Trump was not personally under investigation in the FBI’s inquiry into Russian meddling in the 2016 election.

Trump drafted the letter with senior policy adviser Stephen Miller on an early-May weekend visit to his golf club in Bedminster, New Jersey, and then shared it with senior aides during an Oval Office meeting the day before the firing, according to people familiar with the discussions.

Some aides urged caution, these people said. And Trump ultimately sent Comey a far shorter letter that described his decision as having been prompted by recommendations from Attorney General Jeff Sessions and Deputy Attorney General Rod J. Rosenstein, who served as Comey’s direct supervisors — a description that was echoed in initial public statements by White House officials.

The letter, which was first reported by The New York Times, as well as internal White House communications before Comey’s ouster, could now become key evidence for Mueller as he examines whether the Comey firing was part of an effort to obstruct the Russia investigation. The contents of the letter were described in detail by several people who had read versions of it.

The letter documents what the White House eventually acknowledged in the days after Comey’s termination — that Trump had already decided to let the FBI director go before he solicited recommendations from Sessions and Rosenstein.

Mueller is likely to look into whether Trump, in consulting the Justice Department’s top two officials, was seeking a pretense to remove the FBI director or, as some White House advisers said Friday, he was simply persuaded by his staff that their opinions should play a role in the process.

“I can’t comment on anything the special counsel might be interested in,” White House attorney Ty Cobb said. “But this White House is committed to being open and transparent with the special counsel’s investigation.”

A Mueller spokesman declined to comment.

Trump formally fired Comey late on Tuesday, May 9, dispatching his longtime security chief Keith Schiller to the Justice Department to hand-deliver his short termination letter. Attaching letters he had received from Sessions and Rosenstein, Trump wrote, “I have accepted their recommendation and you are hereby terminated and removed from office, effective immediately.”

The draft letter, however, shows that Trump had made up his mind during conversations that took place earlier at his New Jersey club.

As the president stewed that weekend, he was surrounded by only a small handful of the aides — Miller, his daughter Ivanka Trump, and his son-in-law and adviser Jared Kushner.

Comey had become an increasing irritant to the president, announcing in late March that the FBI was investigating whether there was any coordination between the Trump campaign and Russia.

According to testimony Comey provided to Congress, he had told President Trump privately that the investigation was not focused on him personally — and Trump had been pressuring him to make a similar public announce, but he was hesitant, partly out of fear that he would then be obligated to update the public should Trump later fall under investigation.

People familiar with the letter said Trump provided the contents of the letter, which was formally drawn up by Miller at Bedminster. They said it did not dwell on Russia.

Instead, it contained language similar to what was included in the final version ultimately sent by Trump: “While I greatly appreciate you telling me, on three separate occasions, that I am not under investigation, I nevertheless concur with the Department of Justice that you are not able to effectively lead the bureau.”

The White House declined to comment on Miller’s behalf.