Republican Rep. Trey Gowdy tore into FBI official Peter Strzok during Thursday's hearing before the House oversight and judiciary committees, accusing him of "textbook bias" with his anti-Trump texts.

A lengthy and fiery exchange between the two ended with a sharp rejoinder from the former prosecutor.

After Strzok said he was booted from the Russia probe over an "appearance" issue and not because of "bias," he said he didn't appreciate Gowdy saying otherwise.

“I don’t give a damn what you appreciate, Agent Strzok,” Gowdy shot back. “I don’t appreciate having an FBI agent with an unprecedented level of animus working on two major investigations in 2016.”

Gowdy earlier argued that, in his mind, Strzok had former Secretary of State Hillary Clinton "winning the White House" before he finished her investigation but had President Trump "impeached" before he began working on the probe of his campaign ties to Russia. Gowdy was citing derogatory comments Strzok made in text messages while working on the investigations.

"Agent Strzok had Hillary Clinton winning the White House before he finished investigating her,” Gowdy said. “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.”

Gowdy then berated Strzok over the content of his text messages, his purported bias against Trump and why he was taken off of Special Counsel Robert Mueller’s investigation into Russian meddling into the 2016 election.

Strzok was testifying publicly on Capitol Hill for the first time since the release of a Justice Department inspector general report that heavily criticized his comments. Strzok has claimed he never allowed personal opinions to taint his work.

Strzok says an infamous text message saying "we'll stop" the election of Donald Trump was written in response to a series of events including Trump's "disgusting" insult of the family of a fallen American soldier. Strzok appeared to refer to derogatory statements Trump made about the family of U.S. Army Capt. Humayun Khan, who was killed in Iraq in 2004.

Following Gowdy’s questioning, Strzok responded strongly saying that he takes “great disagreement” to the allegations brought against him by the South Carolina legislator and that Strzok’s text messages represented his personal feelings and did not affect his work at the FBI.

“At no time, in any of these texts, did those personal beliefs ever enter into the realm of any action I took,” Strzok said. “And the suggestion that I, in some dark chamber in the FBI, would somehow cast aside all of these procedures, all of these safeguards, and somehow be able to do this is astounding to me.”

Strzok added: “The proposition that that is going on or that it might occur in the FBI deeply corrodes what the FBI is in American society, the effectiveness of their mission and it is deeply destructive.”

During Gowdy’s questioning, the hearing quickly devolved into chaos as Republicans demanded he answer questions about the Russia investigation and Democrats tried to sideline proceedings with their own requests.

Republican and Democratic lawmakers openly yelled at one another as House Judiciary Committee Chairman Robert Goodlatte said Strzok needed to answer GOP questions and suggested they might recess the hearing and hold him in contempt.

Strzok said he could not answer a question about the early stages of the FBI investigation into Russian intervention because the probe is still ongoing and FBI counsel had instructed him not to. Democrats objected to Goodlatte's repeated attempts to get Strzok to answer.

At one point, Goodlatte told Strzok he could only consult with his own lawyer, not an FBI lawyer.

Goodlatte eventually let the hearing proceed without calling the panel into recess.

The Associated Press contributed to this report.