On the eve of his first public account of the events leading up to his firing, former FBI director James Comey has released part of his testimony and posted it to the Senate panel's website, indicating that U.S. President Donald Trump asked him to quash an agency probe into his national security adviser, Michael Flynn, who was forced to resign in February.

"I need loyalty, I expect loyalty," Trump is alleged to have said.

Comey, who will testify in person to the Senate intelligence committee on Thursday, will use his opening statement to recount a dinner he had with Trump on Jan. 27, a week after the president took office.

Trump, Comey says, indicated that Flynn had made a mistake lying to Vice-President Mike Pence, but hadn't done anything wrong in his earlier contacts with Russian officials.

"I hope you can see your way clear to letting this go, to letting Flynn go. He is a good guy. I hope you can let this go," Comey reports Trump as saying.

Assured Trump

Comey says later in the seven-page statement he believed Trump was only referring to the investigation of Flynn, and not the broader investigation into possible links between Russia and Trump's campaign, but allows, "I could be wrong."

Comey also reveals that in January, he "offered Trump that assurance" that he wasn't personally under investigation.

Comey's testimony is scheduled to begin at 10 a.m. ET on Thursday, and will be shown live on CBC News Network, our live blog at CBCNews.ca, CBC News Facebook and on YouTube .

Questions about Russia's role in the 2016 presidential election, and ensuing congressional and FBI investigations into Moscow's ties with Trump associates, have dogged the president since he took office.

Comey said that Trump in March and April requested in conversations that the FBI director remove "the cloud" over him due to the media coverage into Russian links, and said it was affecting his ability to do his job as president.

"On the morning of April 11, the president called me and asked what I had done about his request that I 'get out' that he is not personally under investigation," he writes of what would be their last conversation.

Trump fired Comey on May 9, less than five years into the 10-year term for an FBI director.

Trump feels 'vindicated'

When questioned by reporters on Wednesday about Comey's pre-released testimony as he returned to the White House from a trip to Cincinnati, Trump didn't respond. He walked across the South Lawn and made a beeline for a group of tourists who cheered as he exited the helicopter. He then went to the Oval Office.

President Donald Trump waves as he walks back into the White House in Washington after returning from a trip to Cincinnati Wednesday. His lawyer released a statement saying Trump feels 'completely and totally vindicated' by James Comey's pre-released testimony that the president was not under investigation in the Russian probe. (Pablo Martinez Monsivais/Associated Press)

But Trump's attorney, Marc Kasowitz, later released a statement saying the president feels "completely and totally vindicated" by Comey's statement to the Senate intelligence committee that he told Trump he was not personally under investigation.

"The president is pleased that Mr. Comey has finally publicly confirmed his private reports that the president was not under investigation in any Russian probe," the statement said.

9 conversations with Trump, Comey says

When Comey was fired, the White House tried to suggest it was for mishandling the investigation into Hillary Clinton's use of a private email server while secretary of state, but the president on May 11 undermined that argument in an NBC News interview.

"In fact, when I decided to just do it [fire Comey], I said to myself, I said, you know this Russia thing with Trump and Russia is a made-up story, it's an excuse by the Democrats for having lost an election they should have won," he told NBC's Lester Holt.

Both the White House and Trump denied that the president had demanded loyalty from Comey at their January dinner, which had also been reported by the New York Times.

The Senate and the House are each investigating allegations of Russian interference into the presidential election, as well as more narrowly focused probes into Flynn. These investigations can't lead to criminal charges, but testimony from Comey and others could lead to a finding that the president obstructed justice.

Former FBI director Robert Mueller, appointed special counsel, has inherited the investigations Comey previously oversaw. Those probes do involve subpoena power and the ability to recommend charges.

Elsewhere, Comey says he was engaged in an unusual amount of one-on-one conversations with Trump over four months, compared with his dealings with predecessor Barack Obama.

"I can recall nine one-on-one conversations with President Trump in four months — three in person and six on the phone," he says.

Comey says he had just two meetings alone with Obama from the time he was confirmed as director in 2013.

White House officials had weighed trying to block Comey from testifying by arguing that his discussions with the president pertained to national security and that there was an expectation of privacy. However, officials ultimately concluded that the optics of taking that step would be worse than the risk of letting the former FBI director testify freely.

Coats and Rogers testify

Earlier Wednesday, U.S. intelligence chiefs faced questions from the Senate committee.

Both Michael Rogers, the National Security Agency director, and Director of National Intelligence Dan Coats declined to describe conversations with Trump, but said they had not been directed to do anything they considered illegal or felt pressured to do so.