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, Mr Comey announced the decision to reopen the investigation into Mrs Clinton's use of a private email server, which led to damaging headlines for the Democratic candidate. Mrs Clinton has since blamed the FBI director for costing her the presidency.
But Mr Comey, in the most extensive comments yet defending his actions, said it would have been far worse to conceal his decision. Mr 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 Mrs Clinton's time as secretary of state could have been found on the laptop of Anthony Weiner, husband of Mrs Clinton's assistant Huma Abedin. He told agents to get a warrant for the laptop.
Mr 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 Mrs Clinton. But Democrats believe the damage to their standard bearer had already been done.
Mr 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."
Mr Comey said it had been established that Miss Abedin had sent classified emails to Mr Weiner for him to print out so she could give them to Mrs Clinton. Asked if people forwarding classified information could have committed a crime he said "potentially".
He said there was an investigation into Miss Abedin and Mr 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 Mrs Clinton.
Mr Comey also said he had "high confidence" Russia meddled in the election in favour of Mr Trump by hacking Democratic Party emails. He believed that was because Vladimir Putin, the Russian president, "hated and wanted to harm in any way" Mrs 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. Mr Comey added: "I think one of the lessons that the Russians may have drawn from this is, this works."