The compromise about his testimony was reached a day before a federal court hearing about Mr. Comey’s request; a motion to quash the subpoena was withdrawn.

In a statement on Sunday, Representative Bob Goodlatte, a Republican from Virginia and the chairman of the Judiciary Committee, said: “There was no need to use baseless litigation in an attempt to run out the clock on this Congress, and I am glad that it was withdrawn. Mr. Comey will join us for a closed-door transcribed interview later this week. We will release the transcript of his interview to the public as soon as possible after the interview, in the name of our combined desire for transparency.”

With Democrats a month away from seizing the majority in the House and preparing to issue their own wave of subpoenas against Trump administration officials, House Republicans are trying to leverage the short time they have left in power to question Mr. Comey and make a case that the nation’s top law enforcement agencies — the F.B.I. and Justice Department — have been tainted by partisan bias against the president.

Mr. Trump fired Mr. Comey in May 2017 as he was leading an investigation into whether Mr. Trump’s campaign colluded with the Russian government to direct the outcome of the 2016 presidential election. Mr. Trump explained the dismissal by citing Mr. Comey’s handling of the investigation into Hillary Clinton’s use of a private email server.

Mr. Trump’s former personal lawyer and fixer, Michael D. Cohen, who was the point person at the Trump Organization to negotiate a deal to build a grand skyscraper in Moscow, pleaded guilty on Thursday to lying to Congress about the duration of the negotiations and the extent of the involvement of Mr. Trump — who is identified in court documents as “Individual 1.”