Former CIA Director David Petraeus has testified on Capitol Hill about the September attack on the US diplomatic mission in Benghazi, Libya.

Mr Petraeus told Congress that he and the CIA had sought to make clear from the outset that the deadly attack involved an al Qaeda affiliate, lawmakers said.

Mr Petraeus, a week after he quit as CIA chief because of an extramarital affair with his biographer, Paula Broadwell, was able to avoid the throng of media gathered on Capitol Hill for the closed-door hearings.

Some lawmakers, however, were eager to give their assessment of the testimony.

Representative CA Dutch Ruppersberger, the House of Representatives intelligence committee's top Democrat, said Mr Petraes testified that "there were extremists in the group" that launched the initial attack on the diplomatic mission, describing them as affiliates of al Qaeda and other extremist groups.

"He clarified that after more information came in it was not a protest," said Mr Ruppersberger.

"But he also did clarify - which is very important and relevant because this has been a debate for a long time - that he made in this statement to us that there were extremists in the group and that they were al Qaeda affiliates, some were al Qaeda affiliates, and that was very important because that's been a debate for the last three or four weeks."

Another lawmaker, Republican Representative Peter King, said Petraeus's account in the session differed from the assessment that the CIA chief gave to Congress two months ago, just days after the attack.

"His testimony today was that from the start he had told us that this was a terrorist attack, there were terrorists involved at the start," said Mr King.

"I told him my questions had a very different recollection of that. The clear impression we were given was that the overwhelming amount of evidence was that it rose out of a spontaneous demonstration and was not a terrorist attack."

Mr Petraeus, a retired Army four-star general, later appeared before the Senate intelligence panel.