Tonight we have stunning new twists in the sex scandal that brought down david petraeus, head of the cia. His resignation shocked the nation. A four-sta general in charge of our nation's secrets admitting an extramarital affair with the woman who penned his biography. A simple e-mail cybertrail, his undoing. Martha raddatz has the latest. Reporter: When general david petraeus granted paula broadwell exclusive and extraordinary access to pen his biography, he likely never imagined it would lead to his downfall. But tonight, his reputation is solid, the fbi is under scrutiny and agents have descended on broadwell's home to gather more material. Material broadwell is now willingly providing them in this increasingly strange scandal. The affair first came to light this summer as part of an fbi investigation prompted by a complaint from this woman, jill kelly, a private citizen and military supporter who had befriended petraeus and his wife holly. Kelly received harassing e-mails from an anonymous account and took them to a friend at the fbi in may or june. The bureau obtained a court order and electronically traced the accounts to petraeus' biographer. Broadwell eventually turned her computer over to the fbi. They were stunned to discover hundreds if not thousands of e-mails some salacious between petraeus and broadwell. And the fbi, that's why they call it a preliminary investigation, and realized they had general petraeus caught up in this in some form or fashion and that really caused them to take it all the way through to see what they really had. Reporter: So many questions remain about how and when the affair began and who the woman behind it all really is. Paula broadwell was exceptional. High schoolvaledictorian, homecoming queen, west point cadet, rising to a lieutenant colonel in the army, married with two young sons, she approached petraeus about research she was doing as a graduate student at harvard. I went up to him and said, you should really read it and he was kind enough to indulge me and take the paper and give me his business card. Reporter: That research eventually led to the unprecedented access to the general while he was commanding forces in afghanistan. Broadwell took six trips she described as embeds with the general. You know it's not a ha haigography. Reporter: Retired general john naugle has known him for 25 years. Were you surprised at the access? I was surprised at the access. My friends who were there tell me that she had extraordinary access and that it worried them. It concerned them. Welcome. Thank you, pleasure to be here. Reporter: Broadwell embarked on a publicity tour promoting the book, it's now clear the affair was ongoing at that time. She spoke about petraeus on "the daily show" with jon stewart. To get to know him he wanted to run with you so you ran together. I thought I'd test him but he was going to test me and it ended up being a test for both of us since we both ran pretty quickly but that was the foundation of our relationship. Reporter: Broadwell also got to know petraeus' wife holly. They were both in the front row just seats away from each other during his cia confirmation hearing. with don imus in january. Is he married. He is married to holly petraeus who is a wonderful military spouse. All of us who have known him and worked with him respect him and admire him. I think that's pretty universal. None of us I don't think other than paula would have presumed to speak for him in that way. Reporter: Controversy over how the fbi has conducted its investigation has engulfed washington. Why did the fbi and aney general eric holder wait until just this past wednesday to alert the white house, notably after the election? And why didn't they alert relevant members of congress at all? Officials say broadwell had classified material on her computer which is illegal but the fbi does not currently believe that any of it came from petraeus and so far no charges have been filed against her. She has gone into hiding with her husband and sons, age 4 and 6. Shades on her family charlotte home are drawn. A poignant note etched in chalk on their driveway, dad loves mom. For part, petraeus has reached out to old friends who say he is devastated. What's the first thing he said? He apologized. He said that he felt that he had let the team down. And that he obviously wanted to make it -- to pull his family together and to try to recover from this. Report Reporter: A long way from 2007 in iraq when he talked about the burdens of being the man then considered the nation's most trusted general. The job is so consuming. It is something that takes every waking minute of every day. Reporter: Either way, those duties took him away from his wife and family for the majority of the last decade. I'm martha raddatz, for "nightline" in washington.

This transcript has been automatically generated and may not be 100% accurate.

Now Playing: Germanwings Crash Investigators Piece Together What Happened

Now Playing: How 'Pretty Woman' Would Be Different Today

Now Playing: Turning Junk From Your Garage into Cash

Now Playing: The Pain of Cyberbullying Still Lingers Years Later

Now Playing: {{itm.title}}

{"id":17703821,"title":"Petraeus Sex Scandal: New Details","duration":"3:00","description":"A high-profile mistress, her alleged harassing email to a family friend, and an FBI investigation.","url":"/Nightline/video/petraeus-sex-scandal-details-17703821","section":"Nightline","mediaType":"Default"}