Comey said he wanted to speak in an open hearing, not behind closed doors, which he said would enable Republicans to misrepresent his testimony without the public watching.

In a brief and then in an oral argument before U.S. District Judge Trevor N. McFadden in Washington, Comey’s attorney David N. Kelley cited what he said were numerous leaks that distorted what witnesses said in closed session before the committees.

Kelley said a closed hearing would create “a shadow on the witness but bright lights for the committee member who seeks partisan advantage by peddling a misleading account of the witness’s testimony.”

Comey was due to appear Monday on the Hill, but Kelley disclosed in court that a new subpoena changed the deposition date to Tuesday — so the judge decided he did not have to rule immediately.

From McFadden’s first question, the judge indicated he was not sure he had the authority to tell Congress how to run its investigations. “Am I right,” the judge asked Kelley, “that you’re saying the investigation into this is completely appropriate, your concern is a private meeting with your client? It’s the means, not the ends?”

McFadden cited a 1975 Supreme Court ruling, raised by lawyers for the Judiciary Committee, which invoked the Speech or Debate Clause of the Constitution: that members of Congress are immune from civil suits, or arrest, while performing their duties.

“The speech or debate protection provides an absolute immunity from judicial interference,” the Supreme Court ruled in Eastland v. U.S. Servicemen’s Fund, and any “collateral harm which may occur in the course of a legitimate legislative inquiry does not allow us to force the inquiry to ‘grind to a halt.’ ”

“You’re running into Eastland,” McFadden told Kelley, “particularly when you concede there is a legitimate purpose to uncover what happened in the 2016 election.”

Thomas G. Hungar, the general counsel for the Judiciary Committee, noted that Comey’s appearance was scheduled for a deposition, not a full committee hearing, and that depositions are always closed, whether in Congress or in civil suits around the country. He said they are typically attended by staff and lawyers, and maybe a few members.

The judge asked Hungar if Comey would be free to debrief reporters after the deposition, and Hungar said yes. Hungar also said a transcript of the deposition was typically available within 24 hours, which Comey could then make public.

Because Comey did not file his motion to quash the subpoena until Thursday, and Hungar filed his response shortly before Friday’s hearing, McFadden continued the hearing. He gave Kelley until 2 p.m. Sunday to reply. He told both sides to return to his courtroom Monday at 10 a.m.