Gen. David Petraeus resigned Friday as head of the CIA, because of an extra-marital affair, according to a MSNBC broadcast.

He met with President Barack Obama prior to resigning and his letter of resignation was accepted.

Mike Morrell, who served as deputy CIA director, will assume the position of interim director.

In a statement following the announcement, Obama said Petraeus provided decades of "extraordinary service to the United States." He said those years of service has made America safer and stronger.

The President wished Petraeus and his wife, Holly, "the very best at this difficult time.”

Petraeus, who was expected to testify before Congress about the controversial Benghazi terror attack, was sworn in last September. He was a four-star general with more than 37 years in the United States Army before his role at the CIA. Among his last Army assignments were commanding the International Security Assistance Force, or ISAF, and U.S. forces in Afghanistan from July 2010 to July 2011.

Petraeus has a Ph.D. from Princeton University.

Below is the letter of resignation published by NBC News:

HEADQUARTERS Central Intelligence Agency

9 November 2012

Yesterday afternoon, I went to the White House and asked the President to be allowed, for personal reasons, to resign from my position as D/CIA. After being married for over 37 years, I showed extremely poor judgment by engaging in an extramarital affair. 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.

As I depart Langley, I want you to know that it has been the greatest of privileges to have served with you, the officers of our Nation's Silent Service, a work force that is truly exceptional in every regard. Indeed, you did extraordinary work on a host of critical missions during my time as director, and I am deeply grateful to you for that.

Teddy Roosevelt once observed that life's greatest gift is the opportunity to work hard at work worth doing. I will always treasure my opportunity to have done that with you and I will always regret the circumstances that brought that work with you to an end.
Thank you for your extraordinary service to our country, and best wishes for continued success in the important endeavors that lie ahead for our country and our Agency.

With admiration and appreciation,

David H. Petraeus