The web of extramarital intrigue that led to the resignation of the CIA's director, David Petraeus, was becoming more complex by the hour this weekend.
Not only was the lover of the 60-year-old former four-star general revealed to be Paula Broadwell, the 40-year-old author of an admiring biography of the man, but the mechanism for the affair's discovery turned out to be the CIA's rival agency, the FBI.
The liaison between the pair, both of whom are married, came to light when the FBI investigated an apparent security breach involving Mr Petraeus's emails. What triggered this, according to an Associated Press report, was "harassing" emails sent by Ms Broadwell to another woman close to Mr Petraeus. She has not been named. This led the FBI to uncover extensive evidence of her relationship with the CIA director. There is no suggestion of any criminal wrongdoing by either person, just a lack of discretion. Their email exchanges were inevitably described as containing sexually explicit messages, one possibly referring to manoeuvres under the retired general's desk.
The White House was contacted on Wednesday and told that Mr Petraeus had a potentially serious problem. Events then moved swiftly. Early on Thursday, Mr Petraeus telephoned Thomas Donilon, the National Security Adviser, and asked to meet the President. Later that day, Mr Petraeus met President Obama and said he intended to step down because of the affair. The President reportedly tried to talk him out of it, but accepted his resignation on Friday.
Current and former US military officials said suspicion of infidelities had followed Mr Petraeus for several years. He has been married for 37 years to Holly, an assistant director of the US Consumer Financial Protection Bureau, which counsels service families on financial matters. She and her husband met in 1973 at the US military academy at West Point, where her father was superintendent. In a statement issued to CIA staff, Mr Petraeus said on Friday: "After being married for over 37 years, I showed extremely poor judgement by engaging in an extramarital affair."
Ms Broadwell is a reserve army officer, research associate at Harvard University, counter-terrorism expert and lecturer at West Point currently undertaking a PhD thesis at the Department of War Studies at King's College, London. She is married to Scott, a radiologist, and, when not on the road, lives with him and their two young sons in the Dilworth district of Charlotte, North Carolina.
She was not available for comment this weekend, but in earlier interviews, she said she met Mr Petraeus in 2006 at Harvard, where she was working on a dissertation about leadership. She said they soon started emailing and discussing her research, and after President Obama picked Mr Petraeus to lead US forces in Afghanistan in June 2010, he invited her to Kabul. It was then that she decided to turn her dissertation into a biography, and so made repeated trips to Afghanistan to spend time observing and interviewing Mr Petraeus. The pair regularly went on runs together.
The resulting book, All In: The Education of General David Petraeus, co-authored with a Washington Post journalist and 20 per cent of whose profits go to the Wounded Warriors charity, was thorough but bordered on hagiography. Jon Stewart of The Daily Show said the question it raised was: "Is he awesome, or incredibly awesome?"
In interviews to promote the book, Ms Broadwell told CNN in words now heavy with unintended meaning: "At some point I think he realised I was taking this research very seriously ... But we had a relationship before I went there as far as this dissertation was concerned, so I just took it to another level." The affair began, according to The Wall Street Journal, in August 2011.
Ms Broadwell planned to celebrate her 40th birthday party in Washington this weekend, with many reporters invited. But her husband emailed guests to cancel the event late on Friday. CIA officers had long expressed concern about Ms Broadwell's unprecedented access to the director. She frequently visited the spy agency's headquarters in Langley, Virginia, to meet Mr Petraeus in his office, and often attended public functions as his guest. As a military intelligence officer in the Army Reserve, she had a high security clearance, which she mentioned at public events as one of the reasons she was well suited to write Mr Petraeus's story. But her access was unsettling to members of the secretive and compartmentalised intelligence agency. Military officers close to him insist the affair did not begin when he was in uniform.
The timing of all this is intriguing. First, because none of this surfaced publicly until after Tuesday's presidential election. Second, Mr Petraeus was scheduled to testify next week on Capitol Hill in hearings on the deaths of four Americans, including the US ambassador and two CIA security officers, in Libya in September. The CIA has come under intense scrutiny for providing the White House and other administration officials with information that led them to say the Benghazi attack was a result of a film protest. It has become clear that the CIA was aware the attack was distinct from the film protests across the Muslim world.
Michael Morell, Mr Petraeus's deputy, will now serve as interim director of the CIA.