The weekend before he fired FBI Director James Comey, President Donald Trump drafted a letter to him laying out the reasons why he didn’t want him to stay in the job, a senior Trump administration official said Friday.

Mr. Trump, who worked on the draft at his golf club in Bedminster, N.J., in early May, wanted Mr. Comey to publicly state the president wasn’t personally under investigation in connection to Russia meddling in the 2016 presidential election—an assurance the director had previously given the president privately, a person familiar with the matter said.

Paraphrasing the letter, the administration official said Mr. Trump wanted this message sent: “You’ve told me three times I’m not under investigation but you won’t tell the world, and it’s hampering the country.”

Mr. Comey, testifying before the Senate Intelligence Committee in June, confirmed that during his stint at the FBI, Mr. Trump wasn’t under investigation. The president’s actions—including firing Mr. Comey—are now being examined by special counsel Robert Mueller, who took over the Russia probe after the FBI director was fired on May 9.

Mr. Trump sought to take action because he saw the lingering investigation as a weight on his presidency, underscored by conversations with some foreign leaders who would bring up the Russia probe, according to the administration official. The president wrote the four-page letter with the help of a senior White House aide, Stephen Miller.