The Petraeus scandal has had more twists and turns than a Hollywood thriller as different characters have been introduced one-by-one into a drama that has captivated Washington and left political watchers enthralled.
Whatever the personal failings of the general, his demise and the related matter of the delayed nomination of General John Allen to the post of NATO's supreme commander in Europe are the result of a bizarre confluence of events.
There was the unexplained pique of jealousy that drove Petraeus's lover Paula Broadwell to fire off an email to Allen in May from an account signed "Kelley Patrol," warning him to stay away from Tampa socialite Jill Kelley.
Broadwell also sent Kelley harassing emails in June and July, questioning why she was spending time with Petraeus and Allen and asking if her husband knew of her antics, according to the latest timeline in newspaper USA Today.
Kelley decided in late June to bring the first batch of emails to the attention of a friend -- FBI agent Frederick Humphries II -- a move she lived to regret as she later tried to get the case dropped.
Probing Broadwell's email accounts, cybercrime experts uncovered steamy correspondence between her and Petraeus as well as classified documents, which sparked concerns that national security may have been breached.
Four months later, however, after interviewing the protagonists, the FBI seemingly concluded there was no security breach, no serious criminal activity, and therefore no need to take things any further. It might have ended there.
Enter Humphries, stage left.
The veteran counter-terrorism agent, described by colleagues as a tenacious and hard-charging field operative, reached out on October 27 to Washington congressman David Reichert, a personal acquaintance.
Humphries reportedly felt the FBI might be stalling the investigation for political purposes and -- just days before the presidential election -- passed his information on to Republican House majority leader, Eric Cantor.
Cantor, a leading opponent of President Barack Obama, relayed those concerns to FBI chief Robert Mueller on October 31, having had to wait until the passage of superstorm Sandy.
Realizing his secret would not stay hidden long, Petraeus tendered his resignation to Obama two days after the election, having been advised to do so by the president's Director of National Intelligence, James Clapper.
In an ignominious end to a stellar career, America's most celebrated general in a generation issued a humbling statement that didn't seek to explain his "unacceptable" behavior and "extremely poor judgment."
-- The run 'sealed the deal' --
Petraeus has reportedly told friends that he began his seven-month affair with Broadwell in November 2011, shortly after he hung up his military fatigues to begin his ill-fated tenure as the nation's spy chief.
Broadwell, 40, and Petraeus, 60, first met when he spoke at Harvard University in 2006 and the fitness freaks were clearly impressed by one other as the general handed her his card and offered her help with her studies.
Good to his promise, he invited Broadwell to a run along the Potomac River in the capital in 2008 and, according to the preface to her biography, it was her sprint to the finish after he set a grueling pace that "sealed the deal."
That deal involved unprecedented access to the general as he set about replicating his dramatic success in turning around the Iraq war with a similar surge of American troops in Afghanistan during 2010 and 2011.
"All In: The Education of General David Petraeus," the biography she penned with the help of journalist ghostwriter Vernon Loeb after a half dozen trips to Afghanistan to see her hero in action, is predictably fawning.
By 2009, Broadwell, a married mother of two, was an ambitious major in the Army Reserve who wanted to forge a name for herself in counter-terrorism and foreign policy circles.
The Washington Post reports how she attempted that year to set up an outside review team of Stanley McChrystal's war strategy in Afghanistan only to be thwarted when the general's aides said her credentials were too thin.
These and other knocks may go some way to explaining the extraordinary risks she later took to protect her relationship with Petraeus, risks that ultimately proved his and her undoing.
It is unclear what caused her to go after Kelley, someone she had apparently never met and who has denied any wrongdoing.
Kelley was known in the Tampa area as a socialite who enjoyed throwing parties for military officers and political figures at the $1.5 million mansion she shares with husband Scott.
The attractive 37-year-old daughter of Lebanese refugees clearly relished her role as a volunteer "social liaison" at MacDill Air Force Base, which serves as the headquarters of US Central Command (CENTCOM).
Two of the first people Petraeus met after he took charge of CENTCOM in 2008 were the Kelleys, and he and his wife Holly became close friends of the couple after they threw a welcome party for him.
Petraeus's deputy at that time was Allen, who was also reportedly a guest on occasion at the Kelleys' bay view mansion.
Allen is facing a Pentagon probe into allegedly "flirtatious" correspondence with the socialite. Their email trail is suspiciously long, but the married general says he has never been in the same room alone with her.