The CIA has dismissed as "baseless" and "uninformed" claims made by the former lover of ex-agency chief David Petraeus that Libyan militants were held in secret US prisons prior to the deadly Benghazi consulate attack.

Paula Broadwell, the biographer whose affair with Petraeus led to his abrupt resignation Friday, alleged that the assault, in which US ambassador Christopher Stevens was killed, was an attempt to free men being detained in a covert CIA annex.

Speaking last month at the University of Denver, Broadwell further alleged that Petreaus knew about the secret holding cells.

President Barack Obama stripped the CIA of its power to take prisoners through an executive order signed soon after his inauguration in January 2009.

It put an end to the controversial network of secret jails that operated under the administration of President George W Bush.

The 11 September attack on the US consulate in Benghazi resulted in the deaths of four Americans. The assault – and what the White House was told about the need for additional security prior to the attack – has since been the subject of political debate in Washington.

Congressional bodies are due to hold hearings about the incident on Thursday. Petraeus had been expected to give evidence but his resignation has seemingly robbed lawmakers of the chance to grill him over what he knew, and what he passed on to senior administration figures prior to the attack

Broadwell's allegations over the motive of militants in attacking the consulate are likely to fuel speculation over the timing of Petraeus's resignation.

In an answer to a question reading the CIA chief's handling of the incident, the biographer said: "Now, I don't know if a lot of you heard this, but the CIA annex had actually, um, had taken a couple of Libyan militia members prisoner and they think that the attack on the consulate was an effort to try to get these prisoners back. So that's still being vetted."

She added: "The challenging thing for General Petraeus is that in his new position, he's not allowed to communicate with the press. So he's known all of this – they had correspondence with the CIA station chief in, in Libya. Within 24 hours they kind of knew what was happening."

The comments were recorded and posted in a YouTube clip which has since been taken down.

On Monday, the CIA was quick to shoot down Broadwell's claims.

"Any suggestion that the agency is still in the detention business is uninformed and baseless," agency spokesman Preston Golson said.