WASHINGTON — FBI Director James Comey gave his most exhaustive defense yet Wednesday of his role in politically sensitive investigations, telling a Senate panel that despite feeling ‘‘mildly nauseous’’ at the thought his decisions about a probe into Hillary Clinton might have affected the election, he had no regrets.
He also said he was confident in the FBI’s handling of an ongoing probe of any contacts between Russian officials and associates of President Trump.
Through nearly four hours of sometimes combative questioning from Democrats and Republicans, Comey offered his most full-throated explanation of his actions to date, and he never wavered from his core contention — that the FBI has stayed above the political fray even as its investigators probed senior aides to both the Republican and Democratic presidential candidates.
‘‘Lordy, has this been painful,’’ he said. ‘‘I’ve gotten all kinds of rocks thrown at me and this has been really hard, but I think I’ve done the right thing at each turn.’’
Comey appeared to win few new converts to his way of thinking, given the intense partisanship still swirling around both the now-closed probe of Clinton’s use of a private e-mail server while she was secretary of state, and the current investigation into whether any Trump associates may have coordinated with Russian officials to interfere with the campaign.
After the hearing, Senator Patrick Leahy, a Vermont Democrat, said he was unswayed and that he still believed Comey did the wrong thing by telling Congress days before the election that he was reopening the Clinton probe to examine thousands of e-mails found on the laptop of a spouse of a senior Clinton aide.
‘‘I would have been satisfied if he had done what all Republican and Democratic administrations have done in the past,’’ Leahy said. ‘‘The Justice Department has a procedure. You do not release information like that just before an election.’’
In defending his decisions, Comey offered some new details about what FBI agents found last fall, after they realized a laptop belonging to former New York congressman Anthony Weiner contained thousands of work e-mails involving Clinton. At the time, Weiner was married to Huma Abedin, who was a senior aide to Clinton. Agents were looking at Weiner’s laptop because he was under investigation for possibly inappropriate communications with a minor.
‘‘Somehow, her e-mails were being forwarded to Anthony Weiner, including classified information,’’ Comey said, adding later, ‘‘His then-spouse Huma Abedin appears to have had a regular practice of forwarding e-mails to him for him to print out for her so she could deliver them to the secretary of state.’’
After Comey notified Congress of the Weiner laptop issue on Oct. 28, the Justice Department got a search warrant to examine 3,000 messages that were work-related, Comey said. Of those, agents found a dozen that contained classified information, but they were messages investigators had already seen.
Abedin and Weiner were investigated for the potential mishandling of classified material, but the FBI ultimately dropped the matter.
‘‘Really the central problem we had with the whole e-mail investigation was proving people . . . had some sense they were doing something unlawful. That was our burden, and we were unable to meet it,’’ he said.
Three days before Election Day, Comey notified Congress the e-mails on the laptop did not change the FBI’s view of the case.
Democrats argued that by that point, Comey had critically damaged the Clinton campaign. At an appearance Tuesday, Clinton said that if the election had been held the day before Comey’s first letter, she would have been elected president.
At Wednesday’s hearing, Comey said he was confronted with a difficult choice to ‘‘speak or conceal’’ and that the first was a really bad choice, while the second was ‘‘catastrophic,’’ because when voters learned of the issue after the election, they would have suspected a government coverup.
He added: ‘‘It makes me mildly nauseous to think we might have had some impact on the election. But honestly it wouldn’t change the decision.’’
Comey said he has been interviewed by the Justice Department’s inspector general as part of an internal investigation into how he, his top deputy, and the FBI handled the Clinton case.
The chairman of the committee, Senator Charles Grassley, an Iowa Republican, opened the hearing by saying that ‘‘a cloud of doubt hangs over the FBI.’’ Grassley demanded that the bureau reveal more about how it has handled the probes, and at one point he exclaimed ‘‘ye gads!’’ in frustration at his inability to get more information from the FBI.
‘‘We need to know whether there was anything improper going on between the Trump campaign and the Russians, or if these allegations are just a partisan smear campaign that manipulated our government into chasing conspiracy theories,’’ Grassley said.
Democrats repeatedly contrasted Comey’s decision to talk about the Clinton e-mail investigation while not disclosing that the FBI had begun secretly investigating in late July whether any Trump associates might be working with Russian officials to meddle with the presidential campaign.
‘‘It’s still very unclear — and I hope, director, that you will clear this up — why the FBI’s treatment of these two investigations was so dramatically different,’’ said the top Democrat on the committee, Senator Dianne Feinstein of California.
Comey said he treated both cases consistently and that the biggest difference was that one investigation was over or nearly over, and the other was just beginning.