WASHINGTON — Paula Broadwell first met fellow West Point graduate David Petraeus in the spring of 2006, when she was a graduate student at Harvard’s Kennedy School of Government.

He was a lieutenant general working on a counterinsurgency manual that would be tested during his command in Iraq. The university had invited him to give a speech.

Broadwell was in the Army Reserve after being recalled three times to active duty since the Sept. 11 attacks to work on counterterrorism issues and intended to return to active duty or get into the policy world, according to the preface of the Petraeus biography she would later write with a Washington Post editor.

Petraeus, who held much-praised military commands in Iraq and Afghanistan, resigned Friday after admitting he had an extramarital affair, a disclosure that ended the retired four-star general’s civilian career as director of the CIA.

Broadwell wrote in the preface to “All In: The Education of General David Petraeus,” published by Penguin in January, that while at Harvard, Petraeus passed along his card and offered to help her academic work.

“I later discovered that he was famous for this type of mentoring and networking, especially with aspiring soldier-scholars,” Broadwell wrote, adding that “I took full advantage of his open-door policy to seek insight and share perspectives.”

Broadwell is a research associate at Harvard’s Center for Public Leadership and a Ph.D. candidate in the Department of War Studies at King’s College London, according to her biography on Penguin’s website. According to the Charlotte (N.C.) Observer, she grew up in North Dakota and moved to Charlotte more than three years ago with her husband, a radiologist, and their two young sons.

The book began as research for her dissertation, a case study of Petraeus’ leadership. It evolved into an authorized biography written with Washington Post editor Vernon Loeb after President Barack Obama put Petraeus in charge of Afghanistan in 2010.

Two years earlier, she wrote in the book’s preface, while visiting Washington he had invited her to join him and his team for a run along the Potomac River.

“I’d earned varsity letters in cross-country and indoor and outdoor track and finished at the top of my class for athletics at West Point; I wanted to see if he could keep stride during an interview. Instead it became a test for me,” she wrote. He eventually increased the pace “until the talk turned to heavy breathing, and we reached a 6-minute-per-mile pace. It was a signature Petraeus move. I think I passed the test, but I didn’t bother to transcribe the interview.”