FILE - This Feb. 2, 2012 file photo shows CIA Director David Petraeus testifying on Capitol Hill in Washington. Petraeus has resigned because of an
FILE - This Feb. 2, 2012 file photo shows CIA Director David Petraeus testifying on Capitol Hill in Washington. Petraeus has resigned because of an extramarital affair. (AP Photo/Cliff Owen, File) (Cliff Owen)

WASHINGTON - David Petraeus has resigned as director of the CIA after admitting he had an extramarital affair.

According to his letter of resignation, Petraeus asked President Barack Obama on Thursday to allow him to resign, and on Friday the president accepted.

Petraeus said in a statement that he had shown "extremely poor judgment" in having an affair.