The career-ending affair that led to the resignation of CIA Director David Petraeus had its roots in a multi-year friendship, a flattering book and a young writer who was taken with the four-star general's leadership style.
The affair came to light during an FBI investigation of a complaint that author Paula Broadwell, 40, was allegedly sending harassing e-mails to another woman close to Petraeus, a U.S. official said. That probe also uncovered e-mails related to Gen. John Allen, the top U.S. commander in Afghanistan, and put his nomination for NATO commander on hold.
Here's a look at the anatomy of the affair:
Broadwell meets Petraeus when he speaks at Harvard, where she is a graduate student, according to preface of "All In" -- the book Broadwell wrote about the general's career and his impact on the military. She told the general about her research interests and he agreed to put her in touch with people studying the same issues. "I later discovered that he was famous for this type of mentoring and networking, especially with aspiring soldier-scholars," Broadwell wrote.
The Senate confirms Petraeus as the commanding general for U.S. troops in Iraq.
Broadwell begins her Ph.D. thesis on Petraeus' leadership skills. Some of the interviews were done via e-mail. Others were conducted as Broadwell occasionally ran with the physically fit four-star general, including one time with Petraeus and his team along the Potomac River.
Gen. John Allen begins his assignment as deputy commander of U.S. Central Command (CENTCOM) in Tampa, Florida, serving under Petraeus.
Petraeus is named commander of CENTCOM, based at MacDill Air Force Base near Tampa, where Jill Kelley and her husband attend social events alongside the area's military elite.
Petraeus is diagnosed with prostate cancer. Two months of radiation treatment at Walter Reed follow.
Broadwell moves with her husband Scott and two children to Charlotte, North Carolina.
Petraeus is tapped to replace Gen. Stanley McChrystal as the top commander in Afghanistan. He is confirmed by the Senate on June 30, and takes command on July 4 of that same year.
Allen is named as temporary CENTCOM commander, replacing Petraeus.
Broadwell decides to turn her research into a book and visits Afghanistan multiple times. "We had a relationship before I went there as far as this dissertation was concerned, so it just took it to another level," Broadwell told CNN's Brooke Baldwin in February 2012.
Allen succeeds Petraeus as the top American commander in Afghanistan.
August 31, 2011
Petraeus retires from the U.S. Army and is awarded the Army Distinguished Service Medal.
September 6, 2011
Petraeus is sworn in as new director of the Central Intelligence Agency. Broadwell keeps in contact with Petraeus and is later invited to his office for events.
Petraeus and Broadwell begin their affair about two months after he takes over at the CIA, according to a friend.
January 24, 2012
Broadwell's biography, "All In: The Education of General David Petraeus," is published.
In an interview with her hometown newspaper, the Bismarck Tribune, Broadwell describes Petraeus as an inspirational figure who always takes care of his subordinates.
An American official and a source close to Jill Kelley say Gen. John Allen and other officers begin receiving anonymous e-mails. The e-mails bear the handle "kelleypatrol -- or something similar," an official said, describing the missives as "a warning that Kelley was a seductress or something along those lines." That official called the e-mails "vaguely threatening, but above all weird." The source close to Kelley said Allen forwarded at least one of those e-mails to Kelley, thinking it's a joke. It mentions the upcoming meeting Kelley and Allen are due to have.
Kelley, 37, is an unpaid volunteer social liaison to Joint Special Operations Command, based in Tampa. Kelley and her husband have said they have been friends with the Petraeus family for more than five years.
Kelley and her husband begin to get e-mails from an unknown source, with four different e-mail addresses used, according to sources close to Kelley. Some are directed at her husband.
Kelley complains to an agent she knows in the FBI's Tampa office about threatening e-mails from an unidentified source. Tampa Division Cybersquad begins an investigation. The e-mails do not mention Petraeus, but a U.S. official tells CNN the nature of the messages was along the lines of "stay away from my guy." Another source says they referenced "the comings and goings of the generals and Ms. Kelley."
The identity of that FBI agent was a mystery for days after the scandal broke. He was identified November 14 by the general counsel for the Federal Law Enforcement Officers Association as Frederick Humphries.