In a hearing with the Senate intelligence committee that lasted nearly three hours Thursday, James Comey declared that despite what he says was President Donald Trump's intentions for the former FBI director to drop his investigations into Russia, the country did interfere with the 2016 presidential election.

"There should be no fuzz on this whatsoever. The Russians interfered in our election during the 2016 cycle. ... It was an active measures campaign driven from the top of that government," Comey testified. "That is as unfake as you can possibly get."

Comey said he has no doubt that the Russian government interfered with the 2016 presidential election and confirmed that he believes Russian officials knew about the interference, but said that he saw no indication that the votes cast in the election were altered in any way.

Comey refused to publicly answer if a dossier about Russia trying to influence Trump or his campaign when he was the president-elect.

"Not a question I can answer in open sitting, Mr. Chairman," Comey replied.

During a meeting with the president-elect at Trump Tower regarding the Russian investigation in January, Comey said that he wrote down what was discussed because he was concerned with the type of person that Trump might be.

"I was honestly concerned that he might lie about the nature of our meeting," he said.

That was the start of a rocky relationship between Trump and Comey. In testimony, he had already disclosed that Trump demanded his "loyalty" and directly pushed him to "lift the cloud" of investigation by declaring publicly the president was not the target of the FBI probe into his campaign's Russian ties.

Comey testified that he thought it was odd for the president to demand loyalty from him.

Sen. Marco Rubio, of Florida, asked Comey if he ever told the president that he was not allowed to ask him to drop an investigation.

"I didn't. ... I think the circumstances were such that I was a bit stunned and didn't have the presence of mind," Comey answered, adding that he was not sure if he could tell the president he was wrong.

However, Comey did say that Trump was not under the investigation by the FBI while Comey was director.

Sen. Dianne Feinstein pointedly asked Comey why he thought the president fired him. He answered that he believed it was because of the Russia investigation and how Comey was conducting it and that Trump felt it caused him political pressure.

In earlier testimony, Comey said that the "shifting explanations" of why he was fired were confusing for him because Trump said that he was doing "a great job and extremely well-liked by the FBI workforce." However, he added that the president defamed him.

Comey said he learned through a news story that the president said Comey was fired because of the Russia investigation. The former FBI director also continued, saying it was a lie that the FBI was in disarray.

"The FBI is honest, the FBI is strong and the FBI is and always will be independent," Comey said. He also issued an apology for not saying goodbye to his former colleagues.

Three days after Trump fired Comey on May 9, the president tweeted that Comey should hope there are "no tapes" of their conversations.

But Comey said on Thursday, "Lordy, I hope there are tapes," of his conversations with Trump.

It was because of Trump's tweets about him, Comey said, that he asked a friend to leak the contents of his memo about meetings with Trump.

Comey said in his hearing before the Senate intelligence committee that he felt that releasing the details of his private conversations with the president might prompt the appointment of a special counsel in the case.

The hearing also turned to Hillary Clinton and the email scandal. Comey says that former Attorney General Loretta Lynch urged him to refer to the investigation into Clinton's emails a "matter" instead of an "investigation."

Comey also said he was confused by the request and it was one of the reasons he felt the need to publicly announce his findings in the Clinton email case.

Comey said the other major factor was Lynch's meeting with former President Bill Clinton on the tarmac of an Arizona airport. Comey says he had to announce his findings to protect the credibility of the FBI and the Justice Department.

During the testimony, Comey was asked if ousted National Security Adviser Michael Flynn was in any legal problems and if the president was trying to obstruct justice by asking the ex-FBI director to drop the investigation into Flynn.

Comey replied there was an open FBI criminal investigation into Flynn, his statements and the Russian contacts.

"I don't think it was for me to say whether the conversation I had with the president was an effort to obstruct, but I took it as a very disturbing thing and very concerning," Comey said.

Information from the Associated Press was used in this report.