Paula Broadwell, whose extramarital affair with retired Gen. David H. Petraeus led to his resignation as CIA director, will not be charged with cyber-stalking over e-mails sent to another woman, federal prosecutors said Tuesday.

Broadwell sent harassing e-mails to a Tampa socialite whom she apparently believed was threatening her relationship with Petraeus. The Tampa woman, Jill Kelley, shared the e-mails with an FBI agent, and the agency later opened an investigation.

That inquiry led to the exposure of the affair between Petraeus, 60, and Broadwell, 40, an Army Reserve officer who wrote a book about the former four-star general. Petraeus, who has been married 38 years, acknowledged the affair and resigned as CIA director last month after 14 months in the job.

Robert E. O’Neill, the U.S. attorney in Tampa, said in a letter to Broadwell’s lawyer that she is no longer under investigation.

“As the target of our investigation, we believe that it is appropriate to advise your client that our office has determined that no federal charges will be brought in the Middle District of Florida relating to alleged acts of cyber-stalking,” O’Neill wrote to Robert Muse, Broadwell’s lawyer.

Muse said in a statement, “We are pleased with the decision.”

The Justice Department in Washington declined to comment on the decision.

FBI officials have said they are also investigating the origins of low-level classified documents that were found during a search of Broadwell’s home in Charlotte. The status of that investigation is unclear.

Broadwell, who is married, sent the e-mails to Kelley last summer using four anonymous accounts. In them, federal law enforcement officials said, she warned Kelley to stay away from Petraeus and Gen. John R. Allen, who had replaced Petraeus as the U.S. commander in Afghanistan. Kelley had befriended both men while they were stationed in Tampa as part of the U.S. Central Command.

The FBI was concerned because the e-mails indicated that whoever sent them had extensive knowledge of the personal schedules of Petraeus and Allen, officials said. Investigators traced the e-mails to Broadwell, and she and Petraeus acknowledged their affair.