The capital continues to reel from the sex scandal surrounding David Petraeus, who abruptly resigned last week as the head of the CIA after revelations that he'd conducted an affair with his biographer, Paula Broadwell. As new details emerge, the spotlight has shifted to the FBI's role in uncovering the affair. "High-level officials at the [FBI] and the Justice Department were notified in late summer" of Petraeus' indiscretions, say Scott Shane and Charlie Savage at The New York Times. Yet they failed to fill in President Obama until two days after the election, and kept members of Congress who oversee intelligence matters completely in the dark. A guide to the FBI's role in Petraeus-gate:

How did the FBI get involved?
The FBI began an investigation this summer when Jill Kelley, a social planner at MacDill Air Force Base in Tampa, Fla., reported receiving "harassing" emails from an anonymous account that turned out to be Broadwell's. "Law enforcement officials said the emails indicated that Broadwell perceived the other woman as a threat to her relationship with Petraeus," say Sari Horwitz and Greg Miller at The Washington Post. Kelley and her husband had become friends with Petraeus and his wife, Holly, when Petraeus was the head of Central Command, based in MacDill.

How did the FBI find about the affair?
Investigators, now armed with a warrant, found "sexually explicit emails between two lovers" in Broadwell's account, say Evan Perez, Siobhan Gorman, and Devlin Barrett at The Wall Street Journal. It took agents until late summer to determine that Broadwell's paramour was Petraeus because he was using a pseudonym. According to The Journalagents never actually monitored Petraeus' personal email account.

Whom did the FBI inform?
Though reports about the exact when and how conflict, it seems that Robert Mueller III, director of the FBI, and Attorney General Eric Holder were informed, probably last summer.

Where did the investigation go from there?
FBI agents interviewed Broadwell "for the first time the week of Oct. 21," according to The Times. Broadwell admitted to the affair, and handed over her computer, which turned out to contain classified documents. Broadwell denied that Petraeus had been the source of the documents. A week later, the FBI interviewed Petraeus, who also admitted to the affair and also denied that he had leaked documents to Broadwell. Broadwell was interviewed once more on Nov. 2, four days before the presidential election.

What did the FBI conclude?
Investigators deemed that Petraeus had not committed a crime. The matter was then referred to James Clapper, the director of national intelligence, on Nov. 6, Election Day. Clapper spoke to Petraeus and encouraged him to resign, presumably because Petraeus had set a poor example for the agency, whose members are discouraged from putting themselves in vulnerable positions in which they could be blackmailed. Obama was reportedly informed of the affair on Nov. 8. Petraeus met with Obama that day, and offered to resign. Obama was reportedly reluctant to let Petraeus go, but "made the decision alone overnight" that it was the right course, says The Post.

How have members of Congress responded?
Members of Congress who oversee intelligence matters aren't happy, citing laws that require intelligence committees to be kept "fully and currently informed" of "significant intelligence" issues. "I think we should have been told," said Sen. Dianne Feinstein (D-Calif.), chairwoman of the Senate Intelligence Committee. She said the affair "could have had an effect on national security." Rep. Peter King (R-N.Y.), the chairman of the House Homeland Security Committee, said, "The FBI has a lot of explaining to do, and so does the White House. I have a hard time accepting most of the story we've heard so far. It doesn't add up."

Did the FBI bungle the investigation?
FBI officials reportedly believe it was incumbent on them to investigate the matter fully before informing members of Congress or anyone else. And remember, they have so far insisted that Petraeus did not commit any crimes. "Color me unsympathetic" to Congress' displeasure, says Kevin Drum at Mother Jones. "It was a criminal investigation, and the last thing the FBI should have done is jeopardize it by briefing loudmouth members of Congress. There was also no need to politicize it until and unless they were certain they weren't just chasing ghosts." 

Sources: Mother JonesThe New York Times, The Wall Street JournalThe Washington Post