(CNN) -- The affair that brought an end to David Petraeus' tenure as CIA director came to light during an FBI investigation into a complaint that his biographer Paula Broadwell was sending harassing e-mails to another woman close to him, a U.S. official said Saturday. During the investigation, other communications surfaced between Petraeus and Broadwell, a married mother of two, according to the official. The official did not identify the woman who made the initial complaint and did not know the nature of her relationship with Petraeus. The FBI interviewed Petraeus in the course of its inquiry, said the official, who stressed that the CIA director was never the target of the investigation and his communications were never compromised. The official did not know whether Broadwell was interviewed.
@highlight
A probe into harassing e-mails uncovered communications between Petraeus and his biographer
@highlight
The FBI informed the director of national intelligence of the situation on Election Day
@highlight
Petraeus was never the target of the inquiry, an official says
@highlight
CIA Director Gen. David Petraeus resigned after admitting an affair
CNN has not been able to reach @placeholder for comment.