WASHINGTON ― The idea that the FBI’s actions just before the 2016 election affected its outcome makes FBI Director James Comey “mildly nauseous,” he testified on Wednesday at a Senate Judiciary Committee hearing.

During the hearing, Sen. Dianne Feinstein (D-Calif.) asked Comey to explain his decision to inform Congress ― and therefore, the public ― in a letter that the FBI might be reopening its investigation into Hillary Clinton’s private email server just days before Americans went to the polls.

The FBI director responded by recalling a meeting on Oct. 27, 2016, when he was informed about metadata on former New York Rep. Anthony Weiner’s computer indicating that thousands of emails to and from Clinton, the Democratic presidential nominee, were on the device.

The FBI had never found any emails from Clinton’s first three months as secretary of state, Comey said, and at that point, believed the emails could be relevant to its investigation.

“I’ve lived my entire career by the tradition that if you can possibly avoid it, you avoid any action in the lead-up to an election that might have any impact, whether it’s a dog catcher election or president of the United States,” Comey said. “But I sat there that morning, and I could not see a door labeled ‘No Action Here.’”

Kevin Lamarque/Reuters FBI Director James Comey testifies before a Senate Judiciary Committee hearing on May 3, 2017.

Comey had already announced a decision not to recommend charges against Clinton back in July. The only options he saw, he said, were “speak” or “conceal.” He said that because he had repeatedly told Congress there was no case against Clinton, he needed to tell Congress that the FBI had restarted the investigation.

Speaking “would be really bad” because there was an election in 11 days, Comey said. But concealing would be “catastrophic,” he added.

At that point, Comey couldn’t have known that the FBI would be able to review the emails before the election and determine that they did not change its prior decision.

“Look, this was terrible. 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,” Comey said, though he acknowledged the reaction to the FBI’s decision has been “painful.”

“One of my junior lawyers said, ‘Should you consider that what you’re about to do may help elect Donald Trump president?’ And I said, ‘Thank you for raising that. Not for a moment. Because down that path lies the death of the FBI as an independent institution in America,” Comey said. “I can’t consider for a second whose political fortunes will be impacted in what way.”

Feinstein pushed back on Comey, saying that everyone knew that the letter would have a massive impact, and that the election was “lost” as a result.

This week, Clinton also partly blamed Comey for her loss in November.

“I was on the way to winning, until a combination of Jim Comey’s letter on October 28 and Russian WikiLeaks raised doubts in the minds of people who were inclined to vote for me but got scared off,” Clinton said. “And the evidence for that intervening event is, I think, compelling, persuasive.”

The Justice Department’s Inspector General is currently investigating Comey’s decision.