Photo: Al Drago/The New York Times; Video: By THE ASSOCIATED PRESS

In a sharp exchange two hours into the hearing, Mr. Comey made it clear that the decision not to recommend charges turned on the question of criminal intent, not the conduct itself, which he acknowledged amounted to mishandling classified information.

Representative Will Hurd of Texas, a Republican who served as an officer with the C.I.A., focused on the “top secret” emails on the server, leading Mr. Comey through the significance of “special access programs.” These are the most secret operations and sources in the intelligence world, including information provided by electronic means and people in harm’s way.

Mr. Hurd asked what was protecting the server, given that the investigation showed that at least seven chains of emails were classified at that level. “Well, not much,” Mr. Comey replied. He later acknowledged that the server was vulnerable to exposure to hostile countries.

Mr. Hurd said it was outrageous that there was not a recommendation to prosecute.

“What does it take for someone to misuse classified information and get in trouble for it?” he asked.

“It takes mishandling it and criminal intent,” Mr. Comey said.

“And so an unauthorized server in the basement is not mishandling?” Mr. Hurd said.

“Well, no, there is evidence of mishandling here,” Mr. Comey said. “This whole investigation at the end focused on: Is there sufficient evidence of intent?”

Mr. Hurd, like other Republicans, raised the question of precedent, asking whether the decision not to punish Mrs. Clinton sent a message to others in the government who handle classified information. He asked whether an employee of the F.B.I. should have a private server.

“They better not – that’s one of the reasons I’m talking about this,” Mr. Comey said. He added, “There will be discipline from termination to reprimand and everything in between for people who mishandle classified information.”