Speaking under oath in front of the Senate Intelligence Committee, James Comey spoke about what he saw as shifting justifications for his sudden firing.
He said: “The explanations confused me and increasingly concerned me.”
Mr Comey repeatedly said he believed he was fired because of his investigation into whether Mr Trump’s campaign colluded with Russia to swing the elections.
Then referring to the President’s comments about the FBI being in disarray and poorly led, Mr Comey said: “The administration then chose to defame me and more importantly the FBI.
“Those were lies, plain and simple.”
Mr Comey said that he kept detailed memos of his meetings and calls with Donald Trump because he was “honestly concerned that he might lie about the nature of our meeting”.
He added he “knew there would come a day” he would need a contemporaneous account of the interactions because he was so uncomfortable about Mr Trump’s requests for his loyalty.
He said the President asked him to drop an investigation in to former national security adviser Mike Flynn, and to “lift the cloud” of the Russia investigation.
He revealed that he believed Mr Trump was not asking but directing him to drop an active criminal investigation in to Flynn’s contacts with Russia at a time when Flynn was in “legal jeopardy”.
Mr Comey would not answer questions on whether that amounted to obstruction of justice.
But he said that he was “stunned by the conversation”.
In an explosive revelation, Mr Comey said that when Mr Trump tweeted of the possible existence of tapes of their conversations, he directed a “good friend” to leak the content of his memos to a journalist.
His reason for doing so was to prompt the appointment of a special counsel to oversee the investigation in to whether Mr Trump’s campaign colluded with Russia to influence the election.
I’m pretty sure that Comey’s testimony put his own “character” on trial.
Leaks, admitted weakness, Lynch double standard. Come on now. https://t.co/BHBk83NFhd
— Donald Trump Jr. (@DonaldJTrumpJr) June 8, 2017
He added: “Lordy, I hope there are tapes.”
At the same time, speaking in Washington in front of the Faith and Freedom Coalition (FCC), Mr Trump said he takes elections seriously and will do everything to ensure they will be conducted without interference from anyone.
Remaining defiant, he said to the room full of supporters: “We’re under siege… But we will come out bigger and better and stronger than ever. You watch.”
He went on to say he believed the entrenched interests in Washington are against him but that “we will not back down from doing what is right”.
In May, Robert Mueller was appointed as a special counsel.
Mr Comey said he believed Donald Trump’s repeated discussions about his employment was an effort to “get something in exchange for granting my request to stay in the job”.
He said things became awkward with the President after he asked for his loyalty because “he was asking for something and I was refusing to give it.”
Mr Comey also told the committee that he had “no doubt” about Russia interfering in America’s elections.
“We are talking about a foreign government… [that] tried to shape the way we think, we vote, we act,” he said.
“That is a big deal. They are coming after America. They will be back.
“We remain that shining city on the hill, and they don’t like it.”
When asked directly if he believed Donald Trump colluded with Russia, Mr Comey said: “It’s a question I don’t think I should answer in an open hearing.”
During the briefing Donald Trump’s son Donald Trump Jr kept up a commentary on twitter writing: “Washington DC at its finest. This is what America rallied against, but the DC elite don’t get it or know any other way.”
In a White House press briefing a spokeswoman said that President Trump was not a liar and that she was offended by the question.
Mr Trump’s lawyer has said that the President never demanded “loyalty” from Mr Comey or told him to “let Flynn go”.
His went on to say that Mr Comey could be investigated for “unauthorised disclosures” of “privileged communications” after leaking information to a friend.