At the panel's routine hearing on oversight, the FBI director was grilled about the investigations into alleged Russian meddling in the election and into Clinton's use of a private email server at the State Department. Some Republicans defended Comey's actions and pressed him to reveal what evidence underpins accusations of Trump campaign contacts with Russia.

"This was terrible. It makes me mildly nauseous to think we might have had some impact on the election," Comey told the Senate Judiciary Committee. "I would make the same decision."

Still, he said his decision to tell Congress that the FBI had found new emails that could be relevant to Hillary Clinton' s private email server was not an easy one.

FBI Director James Comey told a Senate committee Wednesday he stands behind his letter that shook up the final days of last year's presidential election — and he would do it again.

While the campaign was still ongoing, Comey did not reveal the existence of the Russia probe, but he did tell Congress that the FBI discovered thousands of messages from the Clinton email domain on the computer of disgraced politician Anthony Weiner, who was married to Clinton aide Huma Abedin. Democrats repeatedly questioned the FBI director about his decision-making process when he sent the letter on Oct. 28, just days before the election.

Animated as he defended his actions, Comey said he has tried over the course of his career to avoid taking any action ahead of an election that could potentially affect the vote. When considering whether to reveal the discovery of the emails, Comey said he considered the "catastrophic" implications of concealing the findings and the "very bad" effects of them potentially becoming public.

Comey said he notified lawmakers about the Clinton-related findings because he had "testified under oath repeatedly" that the investigation was over. Comey said he thought he treated the investigations the same because he did not reveal either probe at their outset.

"If I were not to speak about that, it would be a disastrous, catastrophic concealment," Comey said, repeatedly hitting his hand on the table in front of him.

Comey told lawmakers that those emails marked a major development at the time because investigators thought they may include missing messages.

"If you were standing there, staring at that on October 28, would you really conceal that?" he asked.

In a public appearance Tuesday, Clinton said she had been on track to win November's election until a combination of factors, including Comey's Oct. 28 letter to Congress saying that he would review new emails potentially related to her server, derailed her. While the letter's effect on the election is impossible to ascertain, some Democrats have derided the decision, especially given that the FBI's subsequent review did not lead it to change its previous conclusions about Clinton.

Comey confirmed in March that the FBI is conducting a counterintelligence investigation into Russian influence on the election, including any possible contacts between then-candidate Donald Trump's associates and Moscow. He said the investigation began in July. Critics have questioned why he did not reveal that probe but sent the letter to Congress about the Clinton emails.

Trump has repeatedly denied any collusion with Russia, and Moscow has denied the U.S. intelligence community's conclusions that it meddled in the election.

Republican Sen. John Cornyn of Texas backed Comey's actions, calling it "sad" for people to "condemn" him for telling lawmakers about the emails.

"You were placed in an incredibly difficult position," Cornyn said. "You did the best you could."

Some Democrats echoed Clinton in alleging that Comey's decision affected the election's outcome. Committee ranking member Sen. Dianne Feinstein of California, who pressed Comey about why the letter to Congress was necessary, said the FBI was "noticeably silent" on the Russia probe but made an "explosive announcement" about Clinton just days before an election.

Comey added that he does not expect the FBI will say "another peep" about the investigation into Russian meddling until it is finished.

That probe is still active.

Watch: Comey testifies on the Hill