Former special counsel Robert Mueller had taken himself out of the running to be FBI director by the time he met with President Donald Trump about the job, former Deputy Attorney General Rod Rosenstein told federal investigators.

Notes from Rosenstein's May 23, 2017 interview were made public on Monday as the result of a court ruling in BuzzFeed News' Freedom of Information Act lawsuit against the Justice Department.

The document sheds new light on the circumstances of Trump's May 16, 2017 meeting with Mueller in the Oval Office. Trump has claimed that Mueller applied for the suddenly vacant job of FBI director in that meeting and turned him down. The next day, Mueller was named special counsel investigating links between the Trump campaign and Russian interference in the 2016 election.

In the interview, according to the notes published by BuzzFeed News, Rosenstein described feeling "angry, ashamed, horrified and embarrassed" at how the abrupt firing of then-FBI director James Comey on May 9, 2017 was handled. "It was also humiliating for Comey," his interviewers quoted Rosenstein as saying.

Rosenstein said he spoke to Mueller, a former FBI director, about becoming special counsel the next day.

He had a separate conversation with Mueller and then-Attorney General Jeff Sessions on May 13 to see if Mueller would be interested in returning to his old job as director, the notes say.

"Mueller informed them he did not want to be interviewed for FBI director position," but told them his views about "what should be done with FBI," the document says. "Sessions thought Mueller's comments were 'brilliant,'" Rosenstein is quoted as saying.

"Nevertheless, Mueller was placed on the White House's list of potential candidates for FBI director," the notes say. "Mueller was interviewed for the position of FBI director, but later decided to withdraw from consideration," the notes say.

He was officially named special counsel on May 17.

Trump, who often decried Mueller's investigation as a "witch hunt," has used the Oval Office meeting to suggest that Mueller had a conflict of interest — and that he was lying about their conversation.

“It has been reported that Robert Mueller is saying that he did not apply and interview for the job of FBI Director (and get turned down) the day before he was wrongfully appointed Special Counsel,” Trump tweeted in July ahead of Mueller's testimony before Congress. "Hope he doesn’t say that under oath in that we have numerous witnesses to the interview, including the Vice President of the United States!"

Mueller testified under oath that it was not a job interview. "I interviewed with the president, it was about the job, but it was not about me applying for the job," he added.