United States General David Petraeus has resigned amid a scandal over his extramarital affair.

Washington - Former CIA director David Petraeus is telling friends he was shocked to find that his biographer was suspected of sending anonymous, threatening emails to a Petraeus friend she saw as a romantic rival.

A close associate of the retired general says FBI investigators told Petraeus that Paula Broadwell sent anonymous emails to Jill Kelley, a family friend from his time at Central Command in Florida, warning her to stay away from him.

The Petraeus associate spoke on condition of anonymity to discuss confidential conversations with Petraeus. The CIA director shocked Washington by resigning last week after confessing to the affair.

Petraeus was not shown the emails, but he was told the tone and content seemed threatening to Kelley, prompting her to report them, the associate said.

That triggered an investigation by the FBI. - Sapa-AP