David Petraeus
David PetraeusReuters

CIA Director David Petraeus resigned his post on Friday, admitting that he had shown "extremely poor judgment by engaging in an extramarital affair."

The former Army general had been in charge of the "surge" in Iraq and was later the commander of American forces in Afghanistan.

President Barack Obama said Petraeus had led the Central Intelligence Agency "with characteristic intellectual rigor, dedication and patriotism."

"I am completely confident that the CIA will continue to thrive and carry out its essential mission, and I have the utmost confidence in Acting Director Michael Morell and the men and women of the CIA who work every day to keep our nation safe," the president said in a written statement.

"Going forward, my thoughts and prayers are with Dave and Holly Petraeus, who has done so much to help military families through her own work. I wish them the very best at this difficult time," Obama continued.

Director of National Intelligence James Clapper issued a statement that did not specify a reason for Petraeus' departure but praised his colleague extensively.

"From his long, illustrious Army career to his leadership at the helm of CIA, Dave has redefined what it means to serve and sacrifice for one's country," said Clapper.

Sources said that the woman whom Petraeus had an affair with is his biographer, a fellow West Point graduate 20 years his junior named Paula Broadwell.

"The full back story is not yet clear," said the New York Times, "though his affair came to light after FBI agents conducting a criminal investigation into possible security breaches examined his computer e-mails. The decision to step down was his."

According to Israel's Channel 2 news, the FBI knew of Petraeus's indiscretion for months, making it unlikely that the White House did not know of it as well. This raises the question -- was the affair kept secret unil the elections, in order to spare the Obama administration embarrassment that could have negatively affected Obama's chances for reelection?

Petraeus was due to testify next week in hearings regarding the attack on the U.S.'s Benghazi consulate. Fox News reported that he is now not expected to testify in those hearings.