FBI Deputy Assistant Director Peter Strzok testifies before the House Committees on the Judiciary and Oversight and Government Reform during a hearing on “Oversight of FBI and DOJ Actions Surrounding the 2016 Election,” on Capitol Hill, Thursday, July 12, 2018, in Washington. (AP Photo/Evan Vucci)

WASHINGTON — An FBI agent whose anti-Trump text messages fueled suspicions of partisan bias said at a bitterly contentious and occasionally chaotic hearing in Congress on Thursday that his work has never been tainted by politics, angrily rejecting Republican allegations that he set out to stop Donald Trump from becoming president.

Peter Strzok testified publicly for the first time since being removed from special counsel Robert Mueller’s team, telling lawmakers that texts he traded with an FBI lawyer in the run-up to the 2016 presidential election reflected personal views that he never once acted on.

“At no time, in any of those texts, did those personal beliefs ever enter into the realm of any action I took,” Strzok said.

He insisted under aggressive questioning that an August 2016 text in which he said “We’ll stop” a Trump presidency followed Trump’s denigration of the family of a dead U.S. service member. He said it was his personal view, written late at night and off-the-cuff, of “horrible, disgusting behavior” by the Republican presidential candidate.

But, he added in a raised voice and emphatic tone, “It was in no way — unequivocally — any suggestion that me, the FBI, would take any action whatsoever to improperly impact the electoral process for any candidate.” Some Democrats applauded after he finished speaking.

Republican members of the House judiciary and oversight committees grilled Strzok as they argued that the text messages exchanged with FBI lawyer Lisa Page color the outcome of the Hillary Clinton email investigation and undercut the ongoing investigation into Russian election interference. Strzok, a seasoned counterintelligence agent, helped lead both investigations but has since been reassigned to human resources.

“Agent Strzok had Hillary Clinton winning the White House before he finished investigating her,” said Rep. Trey Gowdy, Republican chairman of the House Oversight and Government Reform Committee. “Agent Strzok had Donald Trump impeached before he even started investigating him. That is bias. Agent Strzok may not see it but the rest of the country does, and it is not what we want, expect or deserve from any law enforcement officer much less the FBI.”

The hearing briefly devolved into chaos and open yelling as Judiciary Committee Chairman Robert Goodlatte said Strzok needed to answer Republicans’ questions and suggested they might recess the hearing and hold him in contempt. Democrats objected to Goodlatte’s repeated attempts to get Strzok to answer. Goodlatte eventually let the hearing proceed without calling the panel into recess.

In his opening statement, Strzok said he has never allowed personal opinions to infect his work, that he knew information during the campaign that had the potential to damage Trump but never contemplated leaking it and that the focus on him by Congress is misguided and plays into “our enemies’ campaign to tear America apart.”

Strzok acknowledged that while his text message criticism was “blunt,” it was not directed at one person or political party and included jabs not only at Trump but also at Clinton and Sen. Bernie Sanders.

“Let me be clear, unequivocally and under oath: Not once in my 26 years of defending my nation did my personal opinions impact any official action I took,” he said.

He said he was one of the few people during the 2016 election who knew the details of Russian election interference and its possible connections with people in the Trump orbit, and that that information could have derailed Trump’s election chances. “But,” he said, “the thought of exposing that information never crossed my mind.”

Although Strzok has said through his lawyer that he was eager to tell his side of the story, he made clear his exasperation at being the focal point of a congressional hearing at a time when Russian election interference has been successfully “sowing discord in our nation and shaking faith in our institutions.”

“I have the utmost respect for Congress’s oversight role, but I truly believe that today’s hearing is just another victory notch in Putin’s belt and another milestone in our enemies’ campaign to tear America apart,” Strzok said. “As someone who loves this country and cherishes its ideals, it is profoundly painful to watch and even worse to play a part in.”

He also flatly rejected the president’s characterizations of Mueller’s work and the threat of Russian election interference, saying, “This investigation is not politically motivated, it is not a witch hunt, it is not a hoax.”

The contentious hearing follows hours of closed-door questioning last week. It also reflects an effort to shift attention away from the content of Strzok’s texts and onto what he says is the more pressing issue: the Russians’ “grave attack” on American democracy and continuing efforts to divide the country.

But Republicans eager for ways to discredit Mueller’s investigation have for months held up the texts from Strzok and Page to support allegations of anti-Trump bias within federal law enforcement.

The Justice Department’s inspector general has criticized Strzok and Page for creating the appearance of impropriety through the texts. But the report said it found no evidence of political bias in the FBI’s decision not to pursue criminal charges against Clinton. And many Democrats say actions taken by law enforcement during the campaign season — including announcing a reopening of the investigation into Clinton just days before the election — actually wound up harming the Democratic candidate and aiding the Republican candidate, Trump.

FBI Director Chris Wray says employees who were singled out for criticism in the inspector general’s report have been referred to internal disciplinary officials. Strzok’s lawyer has said he was escorted from the FBI building last month as the disciplinary process winds its way through the system.

Page, who has also been subpoenaed, is expected to speak to lawmakers at a private meeting Friday.