Former FBI Director James Comey has penned a goodbye letter in which he stressed the "honesty and independence" of the enforcement body after he was sacked by US President Donald Trump.

The 56-year-old New Yorker was fired on Tuesday (10 May) in an episode that many have branded as "Nixonian" and likened to the infamous Watergate scandal.

It came as the FBI was investigating alleged collusion between Russia and the Trump administration during the 2016 presidential election. Trump has now been accused of trying to undermine that probe.

In his goodbye letter, Comey wrote: "I have long believed that a president can fire an FBI director for any reason, or for no reason at all.

"I'm not going to spend time on the decision or the way it was executed. I hope you won't either. It is done, and I will be fine, although I will miss you and the mission deeply.

"I have said to you before that, in times of turbulence, the American people see the FBI as a rock of competence, honesty, and independence.

"What makes leaving the FBI hard is the nature and quality of its people, who together make it that rock for America.

"It is very hard to leave a group of people who are committed only to doing the right thing. My hope is that you will continue to live our values and the mission of protecting the American people and upholding the Constitution.

"If you do that, you too will be sad when you leave, and the American people will be safer.

"Working with you has been one of the great joys of my life. Thank you for that gift."

The letter came as Trump insisted the firing was because Comey "wasn't doing a good job" and was nothing to do with the Russia probe.

However several former FBI agents have come out to speak highly of Comey and said, regardless of the intent, the consequence of the sacking will lead to a "chilling effect" on the Russia investigation.