SHARECOMMENTMORE

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 the affair.

Petraeus has been married for 37 years to Holly Petraeus, whom he met when he was a cadet at the U.S. Military Academy at West Point.

The retired four-star general led the military campaigns in Iraq and Afghanistan, then took the helm of the CIA in September 2011.

The CIA had no immediate comment.

President Barack Obama is praising David Petraeus for a lifetime of service that Obama says "made our country safer and stronger."

Petraeus said he had asked Obama yesterday to let him resign, and the president accepted on Friday.

Obama said Petraeus had provided "extraordinary service to the United States for decades."

He made no direct mention of the reasons for the resignation, but offered his thoughts and prayers to the general and his wife, saying that Holly Petraeus had "done so much to help military families through her own work."

Obama says CIA Deputy Director Michael Morell will serve as acting director.

The president says he's confident that the CIA will "continue to thrive and carry out its essential mission."