James Comey, the FBI director, said he felt 'nauseous' at the thought that he affected the result of last year's US presidential election by reopening a probe into Hillary Clinton's emails days before the vote.
Eleven days before Donald Trump won the race to the White House, Comey announced the decision to reopen the investigation into Clinton's use of a private email server, which led to damaging headlines for the Democratic candidate. Clinton has since blamed the FBI director for costing her the presidency.
But Comey, in the most extensive comments yet defending his actions, said it would have been far worse to conceal his decision. Comey, appearing before the Senate Judiciary Committee, said: "It makes me mildly nauseous to think that we might have had some impact on the election but honestly it wouldn't change the decision.
"I've had a lot of rocks thrown at me but I've done the right thing. I don't have any regrets."
He explained that on October 27 agents presented him with evidence that the 30,000 "golden missing emails" from Clinton's time as secretary of state could have been found on the laptop of Anthony Weiner, husband of Clinton's assistant Huma Abedin. He told agents to get a warrant for the laptop.
Comey said it was a "hard choice" whether to make the reopening of the email investigation public.
He said: "I was looking at two doors marked 'speak' and 'conceal'. I prayed to find a third door but I couldn't. 'Speak' would be really bad. There's an election days away. Lordy, that would be really bad.
"But concealing in my view would be catastrophic, not just to the FBI but well beyond. This was one of the world's most painful decisions. To not speak about it would require an act of concealment in my view."
A few days after the announcement, the FBI, which is supposed to remain politically neutral, said the new emails had not altered its previous decision to recommend no criminal charges against Clinton. But Democrats believe the damage to their standard bearer had already been done.
Comey said before he made the decision an FBI lawyer asked him if he should "consider that what you're about to do may help elect Donald Trump president". He told the committee: "Not for a moment. Because down that path lies the death of the FBI as an independent institution in America.
"I can't consider for a second whose political fortunes would be affected."
Comey said it had been established that Abedin had sent classified emails to Weiner for him to print out so she could give them to Clinton. Asked if people forwarding classified information could have committed a crime he said "potentially".
He said there was an investigation into Abedin and Weiner and it was closed. The FBI could not prove that there had been any intent to commit a crime, just as was the case with Clinton.
Comey also said he had "high confidence" Russia meddled in the election in favour of Trump by hacking Democratic Party emails. He believed that was because Vladimir Putin, the Russian president, "hated and wanted to harm in any way" Clinton, and preferred the prospect of dealing with someone who had a business background.
The director said Russia was still active in US politics and he expected them to interfere in future elections. Russia represented the "greatest threat of any nation on Earth," he said. Comey added: "I think one of the lessons that the Russians may have drawn from this is, this works."
Profile: James Comey
FBI director • Born: 14 December 1960 (age 56) • From: Yonkers, New York • Education: College of William & Mary; University of Chicago Law School
Early career US Attorney for the Southern District of New York and US Deputy Attorney General at the Department of Justice, during the administration of President George W Bush.
Subsequently held General Counsel roles at defence contractor Lockheed Martin and investment fund Bridgewater Associates.
FBI Nominated by President Barack Obama to become the seventh Director of the FBI in 2013. Sworn in on 4 September 2013.
FAQ: Russian hackers
Why are hackers in the news? Over the course of about three years, hackers breached security at Democratic Party campaign organisations and key Hillary Clinton aides. Thousands of internal emails were copied and published via WikiLeaks. The subsequent revelations mired Clinton's presidential campaign in controversy
How was it done? "Spearphishing": targeting individuals with emails that appear to come from a trusted source. In this case, a fake Gmail email alert page. Using the stolen credentials, hackers took control and harvested data
Who did it? Analysts believe that these breaches were carried out by a Russia-based hacking group codenamed "Fancy Bear". The presence of a second Russian hacker group, codenamed "Cozy Bear" was revealed when security experts investigated the DNC leaks
So the Russian government was behind it? It's hard to trace international hackers, who can mislead law enforcement by routing all of their communications through decoys. However, the US government was confident enough to make a formal accusation that the Russian goverment authorised the hacks.
Analysts believe Fancy Bear is backed by the Russian ministry of defence intelligence agency, GRU, while Cozy Bear has in the past been linked to the FSB, the main successor agency to the KGB
Have the same hackers targeted anyone else? Security firm CrowdStrike associates Fancy Bear with hacking the German Bundestag in 2015, along with French television network TV5 Monde and the World Anti-Doping Association. Cozy Bear has launched attacks on the US state department, the Pentagon, and the White House
What about Donald Trump? The CIA believes the hackers favoured Trump as a candidate. However, Fancy Bear primary target was access to the Democratic Party's research on Trump. These files would have included the so-called "Russian dossier", which made a series of embarrassing allegations about the Republican presidential candidate.
Has anything like this happened before? Both the Obama and McCain campaigns were victims of a state-sponsored hack during the 2008 election; the Obama and Romney 2012 campaigns were also besieged by foreign hackers