WASHINGTON — The F.B.I. investigation that led to the resignation of David H. Petraeus as C.I.A. director on Friday began with a complaint several months ago about "harassing" e-mails sent by Paula Broadwell, Mr. Petraeus's biographer, to an unidentified third person, a government official briefed on the case said Saturday.
When F.B.I. agents following up on the complaint began to examine Ms. Broadwell's e-mails, they discovered exchanges between her and Mr. Petraeus that revealed that they were having an affair, said the official, who spoke of the investigation on the condition of anonymity.