Former CIA Director David Petraeus has agreed to testify about the Libya terror attack before the House and Senate intelligence committees, Fox News has learned. 

Petraeus had originally been scheduled to testify this Thursday on the burgeoning controversy over the deadly Sept. 11 attack. That appearance was scuttled, though, after the director abruptly resigned over an extramarital affair. 

The resignation has since expanded into a sprawling scandal that now includes allegations that Gen. John Allen, the top U.S. commander in Afghanistan, exchanged "inappropriate" and sexually charged emails with Jill Kelley, a Florida socialite linked to the Petraeus case. The rapid developments in the case have all but obscured what until last week was an intense debate on Capitol Hill and beyond over the Benghazi terror attack. 

After Petraeus' resignation, lawmakers complained that the scandal was no reason they shouldn't hear from the man at the helm of the CIA when CIA operatives came under attack alongside State Department employees in Benghazi last month. 

The logistics of Petraeus' appearance are still being worked out. But a source close to Petraeus said the former four-star general has contacted the CIA, as well as committees in both the House and Senate, to offer his testimony as the former CIA director. 

Fox News has learned he is expected to speak off-site to the Senate Intelligence Committee on Friday about his Libya report.
The House side is still being worked out. 

Ambassador Chris Stevens and three other Americans were killed in the Sept. 11 attack, which the administration initially blamed on a "spontaneous" mob reacting to protests over an anti-Islam film. Officials later labeled the attack terrorism. 

While Petraeus prepares to give his side, lawmakers have begun to openly question when Petraeus first knew about the investigation that uncovered his affair -- and whether it impacted his statements to Congress on Sept. 14 about the Libya terror attack. 

Petraeus briefed lawmakers that day that the attack was akin to a flash mob, and some top lawmakers noted to Fox News he seemed "wedded" to the administration's narrative that it was a demonstration spun out of control. The briefing appeared to conflict with one from the FBI and National Counterterrorism Center a day earlier in which officials said the intelligence supported an Al Qaeda or Al Qaeda-affiliated attack. 

Rep. Peter King, R-N.Y., told Fox News he now questions whether Petraeus' statements -- which were in conflict with both the FBI briefing and available raw intelligence -- were in any way impacted by the knowledge the FBI was investigating his affair with Broadwell. 

King questioned whether the investigation "consciously or subconsciously" affected his statements to Congress.

Fox News' Catherine Herridge contributed to this report.