Two generals, Agent Shirtless, and 30,000 pages of sexts

The scandal that keeps giving.

Generals Allen (L) and Petraeus (R). Photograph: Nato

Two American generals have been implicated in allegations of sexual misconduct stemming from a bizarre FBI investigation into accusations of online harassment.

General David Petraeus, who ran America's war in Iraq, was forced to resign from his new posting at the CIA on Friday, and today, General John Allen, the top NATO commander in Afghanistan, was also confirmed to be under investigation.

The allegations started with a string of emails received by Jill Kelley, a friend of Petraeus, last June. The emails, while angry in tone, did not apparently hint at any illegitimate activity, nor contain any threats; nonetheless, Kelley's local FBI office in Tampa, Florida, traced the source back to an anonymous gmail account operated by General Petraeus' (married) biographer, Paula Broadwell. Broadwell, according to officials quoted in the NYT, saw Kelley as a rival for her affections with Petraeus.

When the FBI identified the Gmail account as the source of the emails, it managed to receive detailed metadata from Google related to the running of the account – not just the times when the emails were sent, but locations, as well, allowed the FBI to get enough information to identify and then monitor Broadwell.

From there, the agents found that Broadwell and Petraeus "had set up private Gmail accounts to use for their communications, which included explicit details of a sexual nature", according to the Wall Street Journal.

That was the – already tortuous – state of affairs come Friday. Today, the scandal has branched out in a number of directions.

Firstly, General Allen has entered the picture. The FBI has apparently found "between 20,000 and 30,000 pages of 'potentially inappropriate' emails" sent between Allen and Jill Kelley, the recipient of the original angry missives allegedly sent by Broadwell.

Allen's conduct is now being investigated by the Pentagon's inspector general, with Defense Secretary Leon E. Panetta in a statement praising General Allen for his leadership in Afghanistan and saying that “he is entitled to due process in this matter.”

Secondly, the conduct of the FBI has been called into question. Fears were already raised by the ease with which the FBI has acquired confidential data from Google over a case which, regardless of what it turned into down the line, showed little hint of illegality, let alone something worth subpoenaing private communications for.

One of the triggers for the investigation looks likely to be the fact that the angry emails, although anonymous, reflected "an inside knowledge" of Petraeus. "One e-mail accused Ms. Kelley of 'touching' Mr. Petraeus inappropriately under a dinner table," writes the NYT's Scott Shane and Charlie Savage.

But there is another element to the FBI's involvement. Shane and Savage continue:

[Kelley] brought her complaint to a rank-and-file agent she knew from a previous encounter with the F.B.I. office, the official also said. That agent, who had previously pursued a friendship with Ms. Kelley and had earlier sent her shirtless photographs of himself, was “just a conduit” for the complaint, he said. He had no training in cybercrime, was not part of the cyber squad handling the case and was never assigned to the investigation.

It seems doubtful that knowing one FBI agent (who, as the only player in the saga to remain anonymous, has been dubbed "Agent Shirtless) ought to be enough to get the Bureau involved in an investigation into angry emails, even if they do apparently mention General Petraeus.

As well as for the people involved, the affair has also had repercussions for the Obama administration. The resignation of Petraeus came just days before he was due to testify at a hearing over the Benghazi attack – which conspiracists have viewed as a way to take heat off the president – despite the fact that the FBI had known about the affair for over a year. The details of the leak are still being investigated, but it appears to have made its way into Congress via Representative David Reichert, a Republican from Washington state.

This affair just keeps getting weirder and weirder. Expect new revelations as America begins to wake up to the news later today.