David Petraeus, director of the Central Intelligence Agency of the US and a much decorated general, resigned on Friday citing an extramarital affair.
Following his re-election, President Barack Obama was expected to reshuffle his team, with several exits on the anvil. But Petraeus was not among them, the initial unease between them having long gone.
"By any measure, through his lifetime of service David Petraeus has made our country safer and stronger," President Obama said in a statement on Petraeus's resignation.
Petraeus was appointed to the US's premier intelligence service in 2011, ending his time in the army after 37 years of service.
During this time, he became the face of US action in Iraq and Afghanistan and changed the way the US military fought insurgency.
At one time, he was seen as a potential presidential candidate. Then he let himself be persuaded by Obama to take over the CIA, with Leon Panetta, its then chief, moving to defence.
The spy service is famously wary of directors from uniformed services, and there have been a few - General Michael Hayden and Admiral Stansfield Turner - in recent history.
But Petraeus, a fitness fanatic who loved to take colleagues along for a run during lunch break, had won the loyalty of the organisation.
But his leadership had come into question recently over the Benghazi attack on September 11 in which four US diplomats, including the ambassador, were killed.
He was expected to appear for a senate intelligence committee investigating the attack next week. His deputy, Michael Morell, who has been named as interim director, will go instead.