Gen. David Petraeus told friends his affair with his biographer, Paula Broadwell, began after the four-star general left the army in August 2011, sources told ABC News.
Petraeus is said to have been the one to have broken off the extramarital affair.
The 60-year-old's storied career, first as the public face of two wars in Iraq and Afghanistan, and later as director of the CIA, came crashing down on Friday when he announced his resignation from the intelligence agency, citing the indiscretion.
"After being married for over 37 years, I showed extremely poor judgment by engaging in an extramarital affair. Such behavior is unacceptable, both as a husband and as the leader of an organization such as ours," Petraeus said in a statement on Friday.
People close to the general had previously suspected Broadwell's feelings for him had crossed a professional line.
They found the biographer, who spent a year embedded with Petraeus in Afghanistan, to be embarassing and far too "gushy" about him. They said to one another they thought Broadwell "was in love with him," sources told ABC News.
The FBI stumbled upon the extramarital affair while probing a harassing email that had been sent to a woman in Florida. The email was traced to Broadwell's inbox, where investigators are said to have found intimate emails that indicated Petraeus was having an extramarital affair with his biographer.
Investigators uncovered no compromising of classified information or criminal activity, sources familiar with the probe said, adding that all that was found was a lot of "human drama."
Petraeus and his wife Holly, who have been married for more than 37 years, are said to be staying in their Arlington Home and are doing "OK."
"The women in the army are always the strong ones. Holly will survive," a friend of the couple said.
The timing of Petraeus' resignation, which came days before he was scheduled to testify to the House and Senate intelligence committees regarding the attack on the U.S. consulate in Benghazi, "was what it was," an official told ABC News, adding that the time had come to tie up any loose ends in the investigation and confront Petraeus.
The CIA director stepped down from his position as the head of the intelligence agency on Friday, acknowledging he had engaged in an extramarital affair. He did not provide any further details.
"Yesterday afternoon, I went to the White House and asked the president to be allowed, for personal reasons, to resign from my position as D/CIA," he said in a statement. "After being married for over 37 years, I showed extremely poor judgment by engaging in an extramarital affair. Such behavior is unacceptable, both as a husband and as the leader of an organization such as ours. This afternoon, the president graciously accepted my resignation."
Director of National Intelligence James Clapper was made aware of the Petraeus situation on Tuesday evening around 5 p.m. by the FBI, according to a senior intelligence source.
After having several conversations with Petraeus that evening and the following day, Clapper advised Petraeus that the best thing to do would be for him to resign, the source said.
Clapper notified the White House the following afternoon that Petraeus was considering resigning, according to the source.
Petraeus then went to the White House Thursday and told the president he thought he should resign, and the following day the president accepted his resignation, the source said.
Clapper is not currently initiating an investigation into the matter, according to the source.
The news shocked officials in Washington. Petraeus was perhaps the military's most respected general of his generation. He is seen as a problem-solver, and was entrusted with key roles by two presidents from different parties.
Petraeus, then working as a general in Afghanistan, spent a year in close quarters with Broadwell, a 40-year-old married mother of two who embedded with him to write his biography.
In February, when promoting her book, "All In: The Education of General David Petraeus," the West Point and Harvard-educated Broadwell told ABC News' Christiane Amanpour she was able to learn more about what makes the four-star general tick.
"His father doled out what he called gruff love, so he was always working hard to keep his father happy and I think that's reflected in his personality now," she said. "It's interesting to apply that on every one of his assignments, even looking at now, he's trying to please this president."
Broadwell wrote a story that was published this week on Newsweek's website titled "General David Petraeus's Rules for Living." No. 5 is notable in light of the news about his extramarital affair.
"We all will make mistakes. The key is to recognize them and admit them, to learn from them, and to take off the rear-view mirrors -- drive on and avoid making them again," he said.
The departure of Petraeus will add another hole to Obama's leadership team, which is expected to lose some high-profile faces in the coming weeks and months.
Secretary of State Hillary Clinton is among the cabinet members who have said they will not stay in the administration for a second term. A hole at CIA will add yet another position that requires Senate confirmation to that list.