CIA Director David Petraeus resigned his post as head of the spy agency because of an extramarital affair.
In a letter to the CIA workforce, he said that he submitted his resignation to President Barack Obama at the White House on Thursday.
"After being married for 37 years, I showed extremely poor judgment by engaging in an extramarital affair," he wrote. "Such behaviour is unacceptable, both as a husband and as the leader of an organization such as ours."
In a statement, Mr Obama praised Mr Petraeus, 60, for his work at the CIA and for leading US troops in Iraq and Afghanistan.
The sudden departure appeared to end the public career of a man who played a key role in the Iraq war, led the US Central Command and commanded US and NATO troops in Afghanistan, Reuters reports.
Intelligence sources said that Michael Morell, the agency's long-time deputy director, would serve as acting CIA chief for the immediate future.
He had previously served as acting director following the departure of former CIA chief Leon Panetta.
Mr Petraeus' wife Holly has been an advocate for US veterans and head of the Office of Servicemember Affairs at the US Consumer Financial Protection Bureau.