BBC:-Ex-FBI chief James Comey told Congress that the Trump administration’s comments about him and the FBI were “lies plain and simple”.
Mr Comey told a Senate committee they were wrong to denigrate the agency and its leadership.
He was also “confused” by the “shifting explanations” for his sacking, which came as he led a probe into any links between the Trump campaign and Moscow.
President Donald Trump later said he never sought to impede the inquiry.
Mr Trump’s attorney, Marc Kasowitz, said in a statement Mr Comey’s testimony “finally confirmed publicly” that the president was not under investigation as part of any probe in Russian political meddling.
In the statement, Mr Trump also denied asking Mr Comey for his loyalty or to drop an investigation into fired national security adviser Michael Flynn during private meetings.
In his testimony, Mr Comey said Mr Trump had repeatedly told him he was doing a “great” job.
He also suggested he was fired to “change the way the Russia investigation was being conducted”.
The former FBI boss remained largely composed throughout almost three hours of testimony but became impassioned when delivering his opening remarks.
He told the panel that the White House “chose to defame me, and more importantly the FBI” by claiming the agency was “poorly led”.
“Those were lies, plain and simple. And I’m so sorry that the FBI workforce had to hear them,” he continued.
“The FBI is honest. The FBI is strong. And the FBI is and always will be independent,” he said in his opening remarks.
Mr Comey was leading one of several Russia investigations before Mr Trump fired him.
US intelligence agencies believe Russia interfered in the US election and they are investigating alleged links between the Trump campaign and Moscow.
But there is no known evidence of collusion and President Donald Trump has dismissed the story as “fake news”.
His spokeswoman Sarah Sanders on Thursday hit back at Mr Comey, saying: “I can definitively say the president is not a liar.”