Washington (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."

Grateful for a fair hearing from judge. Hard to protect my rights without being in contempt, which I don't believe in. 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. — James Comey (@Comey) December 2, 2018

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.

Read More