Former CIA director David H. Petraeus has agreed to testify to Congress about the Sept. 11 attack in Libya, keeping appointments made before he resigned in disgrace over an extramarital affair.

The appearance will reportedly take place Thursday behind closed doors. But his visit to Capitol Hill will mark Petraeus’s first time in the public view since he resigned Friday.

He is likely to be asked — both by reporters on his way in and by lawmakers — about any possible intelligence breaches involving his biographer, Paula Broadwell. Law enforcement officials said Broadwell is the woman with whom the retired general has acknowledged having an affair.

The FBI searched Broadwell’s home this week, seeking copies of classified documents that investigators have said she possessed. Both Petraeus and Broadwell have denied to investigators that he was the source of any classified information, officials have said.

Senate Intelligence Committee Chairwoman Dianne Feinstein (D-Calif.) told reporters Wednesday that Petraeus has agreed to testify. After his sudden resignation, acting CIA Director Michael Morell had been tapped to appear in Petreaus’s place.

“Gen. Petraeus is willing to come before the committee and the details will be worked out,” Feinstein said.

Several news outlets reported that Petraeus will appear as originally scheduled at closed-door sessions Thursday for the House and Senate intelligence committees. The subject is the deadly attack on the U.S. mission and a CIA base in the Libyan city of Benghazi.

Susan Phalen, spokeswoman for the House Intelligence Committee, said no appearance is confirmed. The Senate Intelligence Committee would not confirm the reports, but a Senate source said an announcement of Petraeus’s appearance is planned for later Wednesday.

Lawmakers of both parties have said they wanted to hear from Petraeus directly, despite his departure. Petraeus had a hand in shaping the Obama administration narrative of the attack, which shifted from a protest gone wrong to an organized terrorist assault. Petraeus also recently visited Libya on a fact-finding mission.

Sen. Susan Collins (R-Maine) said it was “absolutely imperative” that Congress hear from Petraeus.

“There are so many unanswered questions at this point,” Collins told ABC News on Tuesday. “He has a great deal of information that we need in order to understand what went wrong.”

Other congressional leaders had indicated that they could subpoena Petraeus if he declined to appear voluntarily.

Four Americans, including U.S. Ambassador to Libya J. Christopher Stevens, were killed in the Benghazi attack.

President Obama is not involved in deciding whether Petraeus should appear, White House press secretary Jay Carney said Tuesday.

“It is up to Congress to make decisions about who is called to testify,” Carney said. “But the president is confident that acting Director Morell is fully informed and capable of representing the CIA in a hearing about the incidents in Benghazi.”

Ed O’Keefe contributed to this report.