Reporter: As cia director, david petraeus held all of the nation's secrets. But was keeping a big one of his own. Today, in a statement to cia employees, the man considered a national hero by some... See More
Reporter: As cia director, david petraeus held all of the nation's secrets. But was keeping a big one of his own. Today, in a statement to cia employees, the man considered a national hero by some acknowledged the affair and what he called his extremely poor judgment. "Such behavior is unacceptable," the statement said, "both as a husband and as the leader of an organization such as ours." Details about the affair are still emerging. But abc news has learned that the affair was discovered during an fbi investigation into the activities of petraeus' biographer, paula broadwell. The bureau had become concerned with what they called strange activity on the internet by broadwell and that she had also possibly sent e-mails about petraeus to others. Obviously they trusted me, so, I was able to get a lot of great access. Reporter: Earlier this year, broadwell talked on c-span about her professional relationship with petraeus. He put duty in our country and service to the nation above his family. So, I almost consider that a strength and a weakness, you know, as a working mother and wife, my husband works really hard, too, and it's hard to find balance. Reporter: Today, in a statement, the president praised petraeus' dedication and patriotism and said his thoughts and prayers are with dave and holly petraeus. He has spent a lot of time away from home and family under a great deal of stress and, you know, if this shows anything, it shows that david petraeus, after all, is human. Reporter: Petraeus was, in many respects, the public face of the wars. The highly decorated general, often appears before congress. One of the masterminds behind the surge in iraq that ultimately helped bring that war to a close. Then, afghanistan and the call to headcia. Are you ready to come back? Ready for the cia? Well, I feel very fortunate to have been provided such an opportunity to continue to serve and to contribute, if inficonfirmed, but the iraqi people will always be in my mind and in my heart. Reporter: This colonel was petraeus' executive officer in iraq from 2007 to 2008. He had a lot of opportunities in iraq, if he wanted to, to let his hair down, to maybe drink alcohol at one of the embassies, but he wouldn't do it because the troops couldn't do it. And to find out that he had an extramarital affair, it's really -- it's somewhat sad. Repor EVEN AMID THIS Devastating personal scandal, those closest to him speculate petraeus still had the cia's best interest at heart. There is a possibility, if you're the cia director, that someone could use, if they found out about an extramarital affair, they could use it as blackmail against, you sew, it's not surprising to me that he did the right thing and offered to resign. Reporter: Taking over the cia last year, his wife, holly, looking on. Married 38 years to holly, petraeus met her before graduating from west point. She was from a long line of army royalty. Her great great grandfather fought in the civil war. Her own father, a retired four-sneral. Pef tray yus spoke of the young holly he met at west point. I'll never be able to adequately express my love and appreciation for all that she has done, but I can, at least, say here this morning, thanks, holl, I love you. Reporter: Over their nearly four decades together, the family moved 24 times, following petraeus' career. Holly raising two children. And if petraeus was celebrated for his military discipline, for holly, it has been devotion. Army wives have said, "she's one of us." Just this year, she spoke about her favorite poem and its premise. Life is 10% what happens to me and 90% how I react to it. Reporter: News of the affair has sent shockwaves through the national security establishment. Certain limb others have had affairs, in congress, the white house, but having the director is serious business with world leaders, friend and foe, watching his every move and almost certainly looking for vulnerabilities. I'm martha raddatz for "nightline" in washington.
This transcript has been automatically generated and may not be 100% accurate.