July 21, 2008: U.S. Army Gen. David H. Petraeus, the commander of Multi-National Force – Iraq, walks with Sen. Barack Obama after Obama’s arrival to Baghdad International Airport in Baghdad, Iraq.

*Retired Gen. David Petraeus stepped down today as head of the Central Intelligence Agency after admitting to an extra-marital affair.

“After being married for over 37 years, I showed extremely poor judgment by engaging in an extramarital affair, said in a statement announcing his resignation. “Such behavior is unacceptable, both as a husband and as the leader of an organization such as ours. This afternoon, the president graciously accepted my resignation.”

The resignation comes 14 months after Petraeus took the job, days after the presidential election and days before he was set to testify before Congress about an attack on a U.S. consulate in Libya that left four Americans dead.

Central Intelligence Agency Director David Petraeus walks the floor of the New York Stock Exchange to ring the Opening Bell as the CIA Commemorates it’s 65th Anniversary on September 18, 2012 in New York City.

Petraeus met with President Obama on Thursday, at which time the then CIA director offered his resignation, a senior administration official said. According to the source, Petraeus admitted to having an extramarital affair when he asked to resign. The president then formally accepted Petraeus’ resignation in a phone call Friday afternoon, according to the same official.

President Obama said, in a statement, that today he accepted Petraeus’ resignation as CIA director, and is “completely confident that the CIA will continue to thrive and carry out its essential mission,” now under the leadership of Acting Director Michael Morrell.

Obama lauded Petraeus for his “extraordinary service to the United States for decades,” calling him “one of the outstanding general officers of his generation” and praising his work as CIA director.

The president concluded by saying, “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 in this difficult time.”

Holly Petraeus led the Consumer Financial Protection Bureau’s Office for Servicemembers Affairs.