Former FBI director James Comey answers questions during an interview forum at the Washington Post May 8, 2018 in Washington, DC. Comey discussed his stormy tenure as head of the FBI, his handling of the Hillary Clinton email investigation, his tense relationship with President Trump and his controversial firing a year ago, during the forum. (Win McNamee/Getty Images)
Win McNamee/Getty Images
Former FBI director James Comey answers questions during an interview forum at the Washington Post May 8, 2018 in Washington, DC. Comey discussed his stormy tenure as head of the FBI, his handling of the Hillary Clinton email investigation, his tense relationship with President Trump and his controversial firing a year ago, during the forum. (Win McNamee/Getty Images)
Now playing
02:21
Comey: Will testify to Congress in private
stacey abrams john kennedy split
POOL
stacey abrams john kennedy split
Now playing
07:39
'Ok, I get the idea': GOP senator cuts off Stacey Abrams on controversial voting law
CNN
Now playing
03:10
Weir on Biden's vow to cut emissions: It's incredibly hard
Now playing
03:05
Was QAnon used by foreign adversaries?
CNN
Now playing
01:28
Buttigieg: It's going to take a national effort to reach Biden's climate goal
Sen. Lisa Murkowski (R-AK) speaks to reporters as she arrives for the continuation of the Senate impeachment trial of President Donald Trump at the U.S. Capitol on January 29, 2020 in Washington, DC. The next phase of the trial, in which senators will be allowed to ask written questions, will extend into tomorrow. (Photo by Mario Tama/Getty Images)
Mario Tama/Getty Images
Sen. Lisa Murkowski (R-AK) speaks to reporters as she arrives for the continuation of the Senate impeachment trial of President Donald Trump at the U.S. Capitol on January 29, 2020 in Washington, DC. The next phase of the trial, in which senators will be allowed to ask written questions, will extend into tomorrow. (Photo by Mario Tama/Getty Images)
Now playing
04:08
Murkowski explains why she's voting for Biden nominee
President Joe Biden, accompanied by Vice President Kamala Harris, speaks Tuesday, April 20, 2021, at the White House in Washington, after former Minneapolis police Officer Derek Chauvin was convicted of murder and manslaughter in the death of George Floyd. (AP Photo/Evan Vucci)
Evan Vucci/AP
President Joe Biden, accompanied by Vice President Kamala Harris, speaks Tuesday, April 20, 2021, at the White House in Washington, after former Minneapolis police Officer Derek Chauvin was convicted of murder and manslaughter in the death of George Floyd. (AP Photo/Evan Vucci)
Now playing
03:01
'A step forward': Biden speaks after Chauvin's guilty verdict
CNN's Eli Honig explains how much time former police officer Derek Chauvin, 45, could face after he was convicted of second-degree unintentional murder, third-degree murder and second-degree manslaughter in the case of George Floyd.
CNN
CNN's Eli Honig explains how much time former police officer Derek Chauvin, 45, could face after he was convicted of second-degree unintentional murder, third-degree murder and second-degree manslaughter in the case of George Floyd.
Now playing
03:25
Here's the sentence Derek Chauvin could face after guilty verdict
CNN's Van Jones reacts to Attorney General Merrick Garland's announcement that the Justice Department has launched a federal civil probe into policing practices in Minneapolis following the death of George Floyd and the murder convictions for ex-cop Derek Chauvin.
CNN
CNN's Van Jones reacts to Attorney General Merrick Garland's announcement that the Justice Department has launched a federal civil probe into policing practices in Minneapolis following the death of George Floyd and the murder convictions for ex-cop Derek Chauvin.
Now playing
03:08
Van Jones reacts to Justice Department's Minneapolis police probe
CNN
Now playing
03:14
'Performative outrage': Avlon on GOP backlash to Rep. Waters
Two Honduran children found clinging to an island surrounded by a powerful current in the Rio Grande were rescued by Border Patrol agents and taken into custody, the region's top border official said, the latest example of the dangers migrants face as a growing number desperately attempt to reach the US.
U.S. Border Patrol
Two Honduran children found clinging to an island surrounded by a powerful current in the Rio Grande were rescued by Border Patrol agents and taken into custody, the region's top border official said, the latest example of the dangers migrants face as a growing number desperately attempt to reach the US.
Now playing
02:22
See Border Patrol rescue 2 migrant children in Rio Grande
Biden speaks from the Treaty Room in the White House on April 14, 2021 in Washington, DC.
Andrew Harnik/Pool/Getty Images
Biden speaks from the Treaty Room in the White House on April 14, 2021 in Washington, DC.
Now playing
02:59
Enten: Biden is focused on what Americans care about
CNN
Now playing
02:40
Biden says he's praying for 'right verdict' in Chauvin trial
ST. PAUL, MN - NOVEMBER 6:  Former U.S. Vice President Walter Mondale concedes the election to his Republican opponent Norm Coleman November 6, 2002 in St. Paul, Minnesota. Mondale and Coleman were in a race for U.S. Senate that was too close to call the evening before.  (Photo by Mark Erickson/Getty Images)
Mark Erickson/Getty Images
ST. PAUL, MN - NOVEMBER 6: Former U.S. Vice President Walter Mondale concedes the election to his Republican opponent Norm Coleman November 6, 2002 in St. Paul, Minnesota. Mondale and Coleman were in a race for U.S. Senate that was too close to call the evening before. (Photo by Mark Erickson/Getty Images)
Now playing
03:00
Walter Mondale dies at 93
george w bush congress immigration rhetoric cbs intv sot mxp vpx_00000000.png
george w bush congress immigration rhetoric cbs intv sot mxp vpx_00000000.png
Now playing
01:25
Bush calls on Congress to tone down 'harsh rhetoric' on immigration
WASHINGTON, DC - MARCH 23: Sen. Ted Cruz (R-TX) speaks at a Senate Judiciary Committee hearing on "Constitutional and Common Sense Steps to Reduce Gun Violence" on March 23, 2021 in Washington, DC.  Many senators spoke both for and against gun control the day after a shooting in Boulder, Colorado where a gunman opened fire at a grocery store, killing ten people. (Photo by Tasos Katopodis/Getty Images)
Tasos Katopodis/Getty Images
WASHINGTON, DC - MARCH 23: Sen. Ted Cruz (R-TX) speaks at a Senate Judiciary Committee hearing on "Constitutional and Common Sense Steps to Reduce Gun Violence" on March 23, 2021 in Washington, DC. Many senators spoke both for and against gun control the day after a shooting in Boulder, Colorado where a gunman opened fire at a grocery store, killing ten people. (Photo by Tasos Katopodis/Getty Images)
Now playing
03:18
Berman on Cruz's latest tweet: 'The pot calling the kettle violent'
(CNN) —  

Former FBI Director James Comey said Sunday that he would sit for a private deposition with House Republicans after filing a legal challenge to force a public hearing.

“Grateful for a fair hearing from judge. Hard to protect my rights without being in contempt, which I don’t believe in,” Comey said in a Twitter post. “So will sit in the dark, but Republicans agree I’m free to talk when done and transcript released in 24 hours. This is the closest I can get to public testimony.”

House Judiciary Committee Chairman Bob Goodlatte, a Virginia Republican, issued a statement later Sunday confirming the planned testimony.

“Mr. Comey will join us for a closed-door transcribed interview later this week,” the statement said. “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.”

Comey also moved on Sunday to withdraw his motion to quash the congressional subpoena and said the hearing scheduled for Monday morning on the matter does not need to happen.

Comey’s attorney, David Kelley, told CNN that the former FBI director has agreed to sit for a voluntary interview on Friday under a set of conditions.

As Comey indicated in his tweet, he will receive a transcript of his testimony and will be free to make public all or part of the transcript as well as any of the questions asked during the interview, Kelley said. In addition, so long as the interview proceeds voluntarily, an FBI representative will be present to give advice about the disclosure of FBI information, he said.

Based on the agreement, Comey was withdrawing his legal motion, and the committee would withdraw its subpoena, Kelley said.

Sunday’s announcement came after both sides appeared in court on Friday as Comey sought to testify in a public setting rather than behind closed doors.

Goodlatte and other House Republicans have been investigating the FBI and Justice Department’s handling of separate probes into Hillary Clinton’s email practices and Russian interference in the 2016 election, and with just a few weeks left before he leaves Congress, Goodlatte has moved to compel testimony from Comey and former Attorney General Loretta Lynch.

Comey pushed back on the subpoena after he received it last month, saying he would be willing to testify in a public setting but did not believe a private interview would be proper.

Goodlatte said Wednesday that he had told Comey they would release the transcript of his testimony and pressed for the former FBI director to submit to the interview.

“I have just offered to Director Comey that the Committees will publicly release the transcript of his testimony following the interview for our investigation,” Goodlatte wrote on Twitter. “This ensures both transparency and access for the American people to all the facts.”

On Thursday, Comey moved to quash the subpoena and maintained that House Republicans would selectively leak his testimony. But ahead of an expected ruling, he said Sunday that he would submit to the interview and touted the offer of a transcript release.