Former FBI Director James Comey on Sunday dropped his challenge to a congressional subpoena issued by Republicans, telling a Washington, D.C., federal judge he's reached an “acceptable accommodation” to voluntarily testify.

Comey is expected to sit for a voluntary interview with the House Judiciary Committee on Dec. 7, according to the agreement. Comey will receive a transcript of the interview when it is available, and will be permitted to make some or all of the transcript public.

The move came two days after the judge heard arguments on Comey's bid to block a subpoena issued by House Judiciary Chairman Bob Goodlatte, R-Virginia. Comey, represented by Dechert partners David Kelley and Vincent Cohen, argued the closed-door questioning proposed by the House committee would fuel partisan narratives and selective leaks.

U.S. District Judge Trevor McFadden, who was appointed by President Donald Trump last year, oversaw the case.

“Mr. Comey asks this court's intervention not to avoid giving testimony but to prevent the Joint Committee from using the pretext of a closed interview to peddle a distorted, partisan political narrative about the Clinton and Russian investigations through selective leaks,” Comey's lawyers wrote in their motion to quash the subpoena. They added: “The public record shows members of the Joint Committee leaking what suits them and maintaining the secrecy only of what does not.”

Comey's attorneys said he would “welcome the opportunity to testify in a public setting concerning the Russia and Clinton investigations.”

The legal team for the House, led by Thomas Hungar, the general counsel, argued in a court filing Friday that history was not on Comey's side.

“Mr. Comey brazenly demands that this Court issue an order quashing a congressional subpoena directed to him—a request for relief so extraordinary and frivolous that, as far as undersigned counsel is aware, no district court in the history of the Republic has ever granted such a request,” Hungar wrote. The House lawyers added: “Try as he might, Mr. Comey may not condition his cooperation with a congressional investigation on the presence of television cameras.”

During a hearing Friday, Kelley argued that the House was using the closed-door process “both as a sword and a shield,” hoping to take “shots in a dark alley” at Comey and then selectively leak to the media to show the public what Republican lawmakers “want them to see.”

“They just want to zero-in and gang up and do it in a non-public way,” Kelley added later in the Friday afternoon hearing.

Hungar said no rule forbids Comey from speaking publicly about his testimony in what amounts to a deposition by lawmakers and House staff.

“That makes absolutely no sense whatsoever,” Hungar said Friday, responding to the claim that Comey would be forbidden from publicly discussing his closed-door testimony. “Mr. Comey has ample opportunity to express his views.”

President Trump fired Comey last year amid claims he inappropriately handled the investigation of Hillary Clinton's use of personal email for official government purposes.

Trump appointed former King & Spalding partner Christopher Wray to replace Comey as the FBI's leader.

Read more: