Rep. Elijah Cummings (D-MD) slammed Republicans Thursday for going too far in their quest for answers regarding Hillary Clinton’s email server.

Cummings came to the defense of FBI Director James Comey, a Republican, who was summoned to testify to the House Oversight Committee about his decision this week not to recommend criminal charges against Clinton. Cummings slammed Republicans for flip-flopping from praise to criticism when Comey did not recommend criminal charges and said that Comey was “on trial” in a sense.

“Amazingly, amazingly, some Republicans who were praising you just days ago for your independence, for your integrity, and your honesty, instantly turned against you, because your recommendation conflicted with the predetermined outcome they wanted,” Cummings said. “In their eyes, you had one job. And one job only: to prosecute Hillary Clinton. But you refused to do so. So now you are being summoned here to answer for your alleged transgressions. And in a sense, Mr. Director, you are on trial.”

The Democratic congressman went on to compare Clinton’s probe to that of retired General David Petraeus who pleaded guilty to charges related to having shared classified information with his mistress and biographer, Paula Broadwell.

“I give House Republicans credit,” Cummings said. “They are not shy about what they are doing. They have turned political investigations into an art form. If our concerns here today are with the proper treatment of classified information, then we should start with a review of our previous hearing on General David Petraeus, who pled guilty last year to intentionally and knowingly compromising highly classified information. The problem is, Mr. Director, we never had that hearing. This committee ignored that breach of national security because it did not match the political goals of House Republicans.”

Committee Chair Jason Chaffetz (R-UT) was quick to respond to Cummings’ comments about Republicans and Petraeus, offering to hold a hearing for him.

“You asked for a hearing on General Petraeus and how that was dealt with: you got it,” Chaffetz said.