WASHINGTON (Reuters) - Former FBI Director James Comey on Sunday withdrew his bid to quash a congressional subpoena compelling him to testify in secret about the bureau’s decisions on investigations ahead of the 2016 presidential election, his lawyer said.

FILE PHOTO: Former FBI director James Comey arrives at the Irish Film Institute for for a public interview in Dublin, Ireland June 22, 2018. REUTERS/Clodagh Kilcoyne

Comey agreed to sit down for a closed-door deposition on Friday. Republicans on the U.S. House of Representatives Judiciary Committee pledged to provide Comey with a full transcript within 24 hours of his testimony, and he will be permitted to “make any or all of that transcript public,” Comey’s lawyer David Kelley told Reuters in a statement.

In addition, a representative from the FBI will attend to help advise Comey on what matters related to the bureau he may divulge.

Comey and the Republican lawmakers reached the new agreement the day before lawyers were to appear at a court hearing. Earlier on Sunday, committee chairman Bob Goodlatte said he expected Comey to drop the legal challenge.

A judge had been set to issue a ruling on Comey’s request to quash the subpoena and halt congressional proceedings - a request that has never previously been granted by a judge in the United States.

At the heart of the case is whether the panel should be able to force Comey to testify in secret about the FBI’s investigations into former Secretary of State Hillary Clinton’s use of a private email server and whether President Donald Trump’s campaign colluded with Russia.

The Republican-led inquiry has been lambasted by Democrats as a partisan effort to undermine Special Counsel Robert Mueller’s investigation into Russian interference in the 2016 U.S. election.

Moscow denies meddling and Trump denies campaign collusion, calling the Mueller investigation a political witch hunt.

Comey, who was fired by Trump in May 2017, is seen as an important witness into whether Trump tried to obstruct the special counsel’s investigation.

Republicans have said the FBI is biased against Trump, pointing to Comey’s decision to publicly announce the FBI would not bring charges against Clinton.

They have also claimed that the FBI made missteps when it applied for a warrant to place former Trump campaign adviser Carter Page under surveillance.

A Justice Department inspector general report earlier this year criticized Comey for his handling of the Clinton matter, but said he did not exhibit political bias.

Kelley argued in court on Friday that Republicans are violating U.S. House rules by not holding a public hearing where all committee members can ask questions.

Kelley accused lawmakers of pushing for a closed hearing so they can selectively leak portions of Comey’s testimony to undermine Mueller’s investigation into Russian interference in the election.

But Thomas Hungar, a lawyer for the U.S. House of Representatives, said a 1975 Supreme Court case known as Eastland v. U.S. Servicemen’s Fund made it clear that the Speech or Debate Clause in the U.S. Constitution provides for complete immunity for the issuance of such subpoenas.

The Republican-led inquiry into the FBI will be shuttered in the coming weeks, as Democrats prepare to take over control of the House of Representatives in January having won the majority in November’s congressional elections.

The Republicans have little time to wrap up their inquiry and produce a report.

Former Attorney General Loretta Lynch, who was in office in 2016, was also subpoenaed and ordered to appear this week for closed-door testimony. A representative for Lynch declined comment last Friday when asked about the subpoena.