I never anticipated the extramarital affair between David H. Petraeus and Paula Broadwell, the woman I’d worked with for 16 months on a book about Petraeus’s year commanding the war in Afghanistan. On rare occasions, her good looks and close access would prompt a colleague to raise an eyebrow about their relationship, but I never took it seriously.

PHOTOS | The retired four-star Army general has resigned as the head of the CIA, citing an extramarital affair.

I certainly wasn’t alone. The unusually close relationship between subject and biographer was no secret by the time President Obama nominated Petraeus as CIA director in the summer of 2011 following his command year in Kabul. America’s most famous and heralded general had granted Broadwell extraordinary access for her book, “All In: The Education of General David Petraeus.” Nor has Broadwell done anything to hide this access or her great admiration of Petraeus since the book was published in January, describing him in terms that are, well, effusive.

So when the news broke Friday that Petraeus was resigning in disgrace because of an adulterous affair, I was dumbfounded. “Could it be Paula?” my friends and colleagues asked immediately. Even then, I said I would give her the benefit of the doubt — until the doubt evaporated a few hours later.

I came by my ringside seat on this epic Washington scandal innocently enough: In July 2010, I got a call from my agent, Scott Moyers in New York, who wanted to know whether I was interested in ghostwriting a war book about Petraeus, who had just been named commander in Afghanistan. I’d just finished ghostwriting a CIA memoir that Scott had represented.

He described his other client, with whom I’d be working, as a woman who had unique access to Petraeus. She was, in Moyers’s telling, a dynamo — a West Point graduate who’d worked in counterterrorism after Sept. 11 and was pursuing a PhD at King’s College in London. It sounded like an incredible opportunity.

As Pentagon correspondent for The Washington Post, I had briefly embedded with the 101st Airborne Division under Petraeus’s command in northern Iraq in the fall of 2003, and found the general — and what he’d accomplished — impressive and inspiring. Mosul, and much of his sector in the north, were largely pacified, and Petraeus granted me unfettered access to his command headquarters and his battalion commanders. We even went running together around one of Saddam’s demi-palaces in Mosul, where his command was bivouacked.

Ultra-competitive

The fact that I was a runner seemed to Moyers to make me the perfect fit for the job. He joked, when he was introducing me to Broadwell, that I was the only ghostwriter who could run with Petraeus — and with Broadwell. Both were ultra-competitive distance runners who prided themselves on speed, and both could do hundreds of push-ups.

I flew to Charlotte and spent an afternoon sifting through an impressive pile of e-mails and documents on Broadwell’s dining room table that she had already compiled as part of a PhD thesis she was writing on Petraeus and his approach to leadership, which he had agreed to help her with after they met at Harvard a few years earlier.

What was she like? Professional, relaxed and clearly excited about the material she had for me in her big, comfortable house in a stately North Carolina neighborhood. She spoke with great affection about her husband, a surgical radiologist whom she’d met in the military, and her two young sons, whom she clearly adores.

We began our work as Petraeus was assuming command of a faltering war effort. Broadwell began reporting, relying on extensive military contacts, among them numerous members of Petraeus’s inner circle. She made her first of four or five lengthy reporting trips to Afghanistan in the late summer of 2010, somehow managing to juggle her responsibilities as a mother of two small boys with trips to a war zone.

As someone who has found himself closer than I ever wanted to be to incoming fire, I was impressed by her energy and commitment to the book. My role was far less dramatic: I sat in my basement in Maryland and wrote what was virtually a real-time narrative fashioned from the torrent of e-mails, documents and interview transcripts Broadwell sent my way.

From the outset, the editors at Penguin Press were quite clear about what they wanted: a book on the rigors of command told from an inside point of view. The ultimate narrative tracked what turned out to be a year in command for Petraeus. The book is not a traditional biography, although it does contain a series of biographical digressions about him. I had no say over the book’s ultimate take on Petraeus, which some have found excessively laudatory. Broadwell was free to make whatever revision or modifications she desired to the text, and did so liberally. To my mind, in any event, the book remains a valuable chronicle of his year in command and makes clear that the war wasn’t going all that well.

Full access

Before Broadwell’s first trip to Afghanistan, I wondered whether she really had the kind of access necessary to deliver the book we’d promised. But she wore down whatever resistance Petraeus may have had to the project, which he never agreed to make an authorized biography.

By the time of Broadwell’s last reporting trip to Afghanistan, her access was exclusive: She flew out of Kabul on Petraeus’s jet after an emotional change-of-command ceremony and accompanied him during a barnstorming tour he made of European capitals on his way back to Washington.

I always thought that Broadwell’s motives were pure, and I always wondered why Petraeus was granting her the access that he did. The two must have seen a lot of themselves in each other — they shared the West Point bond, an addiction to physical fitness and running and an uber-optimistic, never-say-die outlook on life.

Broadwell clearly admired Petraeus as a leader and a military officer. That her dissertation, and ultimately the book, had grown out of a mentoring relationship with Petraeus is something I still take at face value. I never thought they were having an affair — and I still have no idea when the affair actually began. I sent Broadwell an e-mail Monday, letting her know that I was writing this piece and welcoming any comment she chose to make. I have yet to hear back from her.

I always wondered how Petraeus justified his relationship with her to his command staff in Afghanistan. Surely, eyebrows were raised, given the access she received. Female colleagues of mine weren’t shy in remarking about Broadwell’s good looks and her affinity for flashy, cocktail party attire even at staid national security conferences.

Was something going on with Petraeus? I always said I didn’t think so.

Preaching character

I assumed, given how public their semi-official relationship was, that he would never engage in any risky behavior. He’d always preached to his protégés that character was what you did when no one was watching. And he would always hasten to add, from his most public of perches, that “someone is always watching.”

There was no protégé more ardent than Broadwell.

To see both of them fall in such tragic fashion brought to mind a comment by Nick Carraway, the character in “The Great Gatsby,” who says early on in the novel:

“I felt that I wanted the world to be in uniform and at a sort of moral attention forever; I wanted no more riotous excursions with privileged glimpses into the human heart.”

The only contact I had with Petraeus during my work on the book came in 2011 during one of his trips back to Washington while he was still in command of the war. He invited me to go running with him along the Potomac in a gesture that was vintage Petraeus.

No one cultivated e-mail relationships with journalists better than he did; no one could be more personable on a kind of superficial level that nonetheless made people feel good about their interaction with him.

So one morning, at the appointed hour, I showed up at Fort Myer and was met by an aide. He took me to the general’s stately home on the base. Two or three black sport-utility vehicles waited out front, along with a dozen or so aides, junior officers, NCOs, even a security guard from the CIA, since Petraeus had already been nominated to take over the agency.

We drove six miles out along the Potomac, were dropped off, and ran back along the dirt tow path. The commander of the war in Afghanistan and I ran side by side, talking about great world events. I could scarcely believe I suddenly had this kind of access.

Just as I now can scarcely believe where that kind of access led Broadwell, and Petraeus.

Comments our editors find particularly useful or relevant are displayed in Top Comments, as are comments by users with these badges: . Replies to those posts appear here, as well as posts by staff writers.

To pause and restart automatic updates, click "Live" or "Paused". If paused, you'll be notified of the number of additional comments that have come in.

Comments our editors find particularly useful or relevant are displayed in Top Comments, as are comments by users with these badges: . Replies to those posts appear here, as well as posts by staff writers.