FBI found it out in the course of a probe

David Petraeus, 60, the retired four-star General behind the U.S. campaigns in Iraq and Afghanistan, and Director of the Central Intelligence Agency, has resigned amid allegations that he had an extramarital affair with his biographer, a reserve Army officer.

The dramatic development came on Friday, close on the heels of President Barack Obama’s re-election, and it plunged the President’s plan to appoint a raft of new senior staff in his second administration into crisis.

According to the Associated Press, the affair was discovered during an investigation by the Federal Bureau of Investigation, officials said on condition of anonymity. The biographer was identified as Paula Broadwell.

In remarks to staffers, Mr. Petraeus was quoted as saying that he was guilty of “extremely poor judgment” and “such behaviour is unacceptable, both as a husband and as the leader of an organisation such as ours.”

Mr. Petraeus, who has been married for 38 years to Holly, has two children, one of whom was said to have led an infantry platoon in Afghanistan. Mr. Petraeus’ resignation not only adds to the burden of Mr. Obama’s bid to appoint top officials in a new White House, it also complicates his administration’s defence of the CIA after security and intelligence lapses prior to the attack on the U.S. consulate in Benghazi, in which U.S. Ambassador to Libya Christ Stevens and three others were killed. Criticism of the administration’s apparently confused response after the attacks mounted during the Presidential debates between Mr. Obama and his Republican rival Mitt Romney.

Stopping short of any explicit allusion to the reasons for Mr. Petraeus’ resignation, Mr. Obama said in a formal statement: “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 at this difficult time.”

He added words of praise for Mr. Petraeus. “David Petraeus has provided extraordinary service to the U.S. for decades. By any measure, he was one of the outstanding General officers of his generation, helping our military adapt [itself] to new challenges, and leading our men and women in uniform through a remarkable period of service in Iraq and Afghanistan, where he helped our nation put those wars on a path to a responsible end.”