Ousted FBI director says he was fired to undermine probe into Russia-Trump collusion in 2016 presidential campaign.

Former FBI Director James Comey has accused President Donald Trump of firing him to undermine his investigation into Russia’s role in the 2016 election and its ties to the Trump campaign.

“It’s my judgment that I was fired because of the Russia investigation,” Comey told the Senate Intelligence Committee on Thursday.

Testifying under oath in a hearing watched worldwide, the former FBI boss said he believed he was dismissed “to change, or the endeavour was to change, the way the Russia investigation was being conducted”.

Comey also accused the Trump administration of spreading “lies, plain and simple” about him and the FBI after his abrupt sacking, by claiming the bureau was in disorder under his leadership.

“Those were lies, plain and simple,” he said.

But in more than two hours of testimony, Comey would not say whether he thought the president sought to obstruct justice.

Marc Kasowitz, Trump’s personal attorney, said Comey’s testimony “finally confirmed publicly” that the president was not under investigation.

He also denied that Trump had asked Comey for loyalty or to drop a FBI probe into former national security adviser Michael Flynn’s links with Russia.

‘Stunned’

In his testimony, Comey said he was “confused and increasingly concerned” by Trump’s shifting explanations for his dismissal, saying Trump had repeatedly told him he was doing a “great job”.

Comey said it was not for him to decide whether the president’s actions amounted to an obstruction of justice, a serious crime that could lead to impeachment. However, he called the president’s pressures “a very disturbing thing, very concerning”.

READ MORE: Why was James Comey so controversial?

It was a Democrat, Senator Dianne Feinstein of California, who asked the question that many Republicans have raised in the weeks since Comey’s firing, as one media leak followed another revealing Comey’s claims about Trump’s inappropriate interactions with him.

Alluding to an Oval Office meeting during which Comey says Trump asked him to pull back the Flynn probe, Feinstein asked: “Why didn’t you stop and say, ‘Mr President, this is wrong’?”

Comey responded: “That’s a great question … Maybe if I were stronger I would have. I was so stunned by the conversation I just took it in.”

He also described his concerns that Trump was trying to create a “patronage” relationship with him at a dinner during which Trump asked if he wanted to keep his job.

In a startling disclosure, Comey also revealed that he gave one of his memos about Trump to a friend of his to leak to the press in the hope that it might prompt the appointment of a special counsel.

“My judgment was I need to get that out into the public square,” Comey said.

He told senators he had decided he must document every meeting he had with Trump, with a written record because he was “honestly concerned that he [Trump] might lie about the nature of our meeting.

“I knew there might come a day when I might need a record of what happened, not only to defend myself but to protect the FBI.”

Kasowitz, Trump’s lawyer, seized on the admission, accusing Comey of “unauthorised disclosures” of “privileged communications” with the president.

Sarah Huckabee Sanders, a White House spokeswoman, also hit back, telling reporters: “I can definitely say the president’s not a liar.”

OPINION: Comey’s sacking will not be the end of President Trump

In his testimony, Comey said he leaked memos of his conversations after a tweet by the president suggested he may have taped the conversations.

Comey said he did not know if there were tapes of his conversations with Trump, but that they should be made public if they existed.

“Lordy, I hope there are tapes,” Comey said.

The hearing was watched all over the world [Justin Sullivan/AFP]

The former FBI director also stressed the intelligence community’s conclusion that Russia did indeed meddle in the 2016 election.

“There should be no fuzz on this. The Russians interfered,” Comey said firmly. “That happened. It’s about as unfake as you can possibly get.”

Russia has denied such interference and the White House has denied any collusion.

Trump stayed off social media while the drama played out in Congress, but his son, Donald Trump Jr, fired off a series of tweets attacking Comey.