WASHINGTON (AP) - 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 yesterday to allow him to resign, and today the president accepted.

In a statement, Obama said the general has "made our country safer and stronger."

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."

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."

Copyright 2012 by The Associated Press. All rights reserved. Material may not be redistributed.

More From Hot 104.7 - KKLS-FM