WASHINGTON (NBC News) — Fired FBI Director James Comey testified Thursday that he was "confused" and "concerned" when President Donald Trump told the public he was firing him for undermining the morale of the agency he had led since 2013.

"Those were lies, plain and simple," Comey said.

The Trump administration, he said, "chose to defame me and, more importantly, the FBI by saying that the organization was in disarray, that it was poorly led, that the workforce had lost confidence in its leader."

Comey also said that while he didn’t want to express an opinion on whether Trump was seeking to obstruct the ongoing investigation into Russians meddling into the presidential election, he is “sure” the special counsel, Robert Mueller, will be examining that. And he said he is sure he was fired because of "the Russia investigation."

Comey also explained why he wrote memos chronicling his private conversations with Trump: he had a "gut feeling" the president might lie about the nature of the meetings.

"I knew there might come a day when I needed a record of what happened," he said.

Questioned about Trump's public statement that Comey had "better hope that there are no tapes of our conversations," the former director replied, "Lordy, I hope there are tapes."

Comey's forthright and unflinching remarks to the committee — openly acknowledging his fear of the president's mendacity — made for two hours and 40 minutes of dramatic sworn testimony before the Senate Intelligence Committee. There have been only a few similar moments in history where a sitting president was exposed to such scathing congressional testimony from a respected public servant.

While Comey stated emphatically he had no doubt at all that the Russians tried to influence the election, Trump was watching the unfolding drama in the White House dining room with his legal teams and close advisers.

Trump’s outside counsel, Marc Kasowitz, was expected to make a statement after Comey finished his public testimony.

Comey gave Washington and the world a preview of the testimony to come on Wednesday when he released an opening statement in which he revealed that he told Trump on Jan. 6 he was not personally under investigation.

But Comey, fired by Trump last month, also said the president pressured him during a private meeting on March 30 to publicly reveal he was not personally being probed by the FBI. Trump’s reason? He wanted to “lift the cloud” on his presidency, according to Comey.

Trump and Comey met after the ousted FBI chief revealed federal agents were investigating whether the Trump campaign colluded with the Russian effort to meddle with the presidential election.

Under oath, Comey also confirmed an earlier news report that Trump pressured him on Feb. 14 into dropping the FBI investigation of former National Security Advisor Michael Flynn — a tactic Comey considered crossing the line.

Comey told the senators he was taken aback when Trump told Attorney General Jeff Sessions, top Trump adviser Jared Kushner and others to leave the room before he brought up Flynn.

"Why did he kick everyone out of the Oval Office?” Comey asked. "That to me as an investigator is a very significant fact."

Regarding Sessions, Comey hinted at something significant that has not yet been made public. He said he knew ahead of time that Sessions would have to recuse himself from the investigation, but would not discuss the reasons. "We were aware of facts that I can't discuss in an open setting that would make his continuing very problematic," Comey said.

He gave a similar tantalizing answer when asked outright whether Trump colluded with Russia during the election campaign.

"That's a question I don't think I should answer in an open setting," he said. "That is a question that will be answered by the investigation."

Comey also said that when Trump told him he "hoped" the Flynn matter could be settled, a phrase out of ancient English history came to mind.

"It rings in my ears of 'who will rid me of this meddlesome priest?'," he said, referring to the words purportedly said by King Henry II about Thomas Becket in the 12th century. Becket was later killed by Henry's knights, and Becket became a saint.

Asked why he didn't tell Trump this was wrong, Comey responded, "Maybe if I was stronger I would have."

"I was so stunned by the conversation I just took it in," he said.

Comey also admitted that he gave copies of his Trump conversation memos to a good friend, a Columbia University Law professor, with instructions to pass them on to the media, in the hopes that a special counsel would be appointed. NBC News later confirmed that the professor was Daniel Richman, who has known Comey for decades.

In his written statement, Comey wrote that neither he nor his subordinates at the FBI reported the conversation to the Justice Department.

“After discussing the matter, we decided to keep it very closely held, resolving to figure out what to do with it down the road as our investigation progressed,” he wrote. "I think they were as shocked and troubled by it as I was. The reaction was similar to mine. They were all experienced people who had never experienced such a thing so they were very concerned."

Comey also mentioned in the memo a private White House dinner he had with Trump during which he said the president asked for his loyalty.

“I need loyalty, I expect loyalty,” Trump said, according to Comey.

Comey said he could offer honesty.

The former FBI chief said his last contact with Trump was on 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 wrote.

"I replied that I had passed his request to the Acting Deputy Attorney General, but I had not heard back. He replied that 'the cloud' was getting in the way of his ability to do his job."

After Comey's opening statement was released, Kasowitz zeroed-in on one part of Comey’s statement.

“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," Kasowitz said in a statement. "The President feels completely and totally vindicated. He is eager to continue to move forward with his agenda.”

Rep. Adam Schiff (D-California) said Thursday on MSBNC he found Comey’s statement “quite shocking.”

“I think it's hard to reach any other conclusion but that this is evidence of interference and obstruction,” he said.

Ken Dilanian reported from Washington, and Corky Siemaszko from New York.