Senior lawmakers called for an inquiry into the FBI’s handling of the case of CIA Director David H. Petraeus on Sunday as new ­details and questions emerged about the investigation that led to his resignation last week.

Law enforcement sources identified Jill Kelley, 37, of Tampa as the woman whose report of harassing e-mails eventually ­exposed an extramarital affair ­between Petraeus and Paula Broadwell, a former Army officer who wrote a biography of the retired four-star general.

The departure in disgrace of one of the administration’s most respected and prominent figures came as President Obama is re­organizing his national security team for a second term. Petraeus was to have been a primary witness this week at a series of closed-door congressional hearings on possible intelligence and security lapses surrounding the September attack on the U.S. diplomatic mission in Benghazi, Libya.

Sen. Dianne Feinstein (D-Calif.), chairman of the Senate intelligence committee, said Sunday that news of Petraeus’s resignation was “like a lightning bolt” and that top lawmakers had not been aware the inquiry was underway.

Her first inkling, Feinstein said on “Fox News Sunday,” came from media inquiries Friday, just hours before Petraeus’s resignation was announced publicly. She called Petraeus, she said, and he told her of his plans.

“This is something that could have had an effect on national security,” Feinstein said. “I think we should have been told.” She said the panel will “absolutely” investigate why the FBI did not notify relevant officials sooner.

Rep. Peter T. King (R-N.Y.), chairman of the House Homeland Security Committee, said: “It just doesn’t add up that you have this type of investigation. The FBI is investigating e-mails, the ­e-mails leading to the CIA director, taking four months to find out that the CIA director was involved.”

“I have real questions about this. I think a timeline has to be looked at and analyzed to see what happened,” King said on CNN’s “State of the Union.”

The FBI investigation began after Kelley visited the bureau’s Tampa office in early summer and provided investigators with harshly worded e-mails accusing her of seeking an intimate relationship with Petraeus. Kelley, who is married to a Tampa surgeon, met the general when he was head of the Tampa-based U.S. Central Command, from 2008 to 2010. A military official said she was an unpaid volunteer at MacDill Air Force Base, where the headquarters are located.

Petraeus and his wife, Holly, socialized with Kelley and her husband. A photograph in the local newspaper showed the two couples together at a 2010 party at the Kelleys’ six-bedroom waterfront home. Other photos on ­social-media sites showed Petraeus with the Kelleys’ three daughters and the couples at a going-away party for Petraeus in June 2010 as he headed to Afghanistan to command U.S. and international forces there.

Federal law enforcement officials said they did not know the nature of the relationship between Kelley and Petraeus other than that they were social friends. The officials were not authorized to discuss the case and spoke on the condition of anonymity.

The Kelleys have hired Abbe Lowell, a Washington lawyer, and Judy Smith, a crisis manager, who declined to confirm that Kelley was the recipient of the e-mails.

Smith issued a statement Sunday on behalf of the Kelleys, which said: “We and our family have been friends with General Petraeus and his family for over five years. We respect his and his family’s privacy and want the same for us and our three children.”

After Kelley turned over the e-mails, FBI investigators determined that they had come from Broadwell. An examination of Broadwell’s accounts led to the discovery of exchanges between her and Petraeus — who used an address with a fictitious name, not his CIA or military account. The FBI concluded from the ­contents of the e-mails that Broadwell and Petraeus were having an affair.

When Petraeus’s name surfaced, officials said, they did not think it was appropriate to brief anyone outside the Justice Department, including the White House or Congress. The criminal probe was still ongoing, key interviews had not been conducted, and they did not know what role, if any, Petraeus had in the e-mail harassment case, they said.

Before determining whether there had been a security breach, one official said, it would have been premature to discuss such a sensitive issue with anyone outside the investigation. In late summer, after ruling out any ­security involvement, high-level Justice Department officials were informed about the harassment investigation regarding Petraeus.

“The FBI had to get to the bottom of it first,” the law enforcement official said. “They had to figure out whether there was a breach. And they eventually determined there wasn’t. But this took time. And we had to figure out what role, if any, Petraeus had with the harassing e-mails, which turned out to be none.”

During separate interviews with the FBI, officials said, Petraeus and Broadwell admitted to the affair. After a final interview with Broadwell the week of Oct. 22, and with Petraeus the week after, investigators concluded there had been no criminal cyber-harassment.

On Nov. 6, Election Day, the FBI notified Director of National Intelligence James R. Clapper Jr. for the first time of the inquiry and its outcome. Officials said they had followed procedures by notifying Petraeus’s intelligence-community superior only when all the facts had been established.

Clapper spoke by telephone with Petraeus that evening and advised him to resign. On Wednesday, Clapper told the White House, which informed President Obama the next morning. Petraeus offered his resignation to Obama that afternoon; Obama accepted it Friday morning.

A number of lawmakers said they will insist that Petraeus testify during closed-door hearings this week on the Benghazi attack in which U.S. Ambassador J. Christopher Stevens and three other Americans were killed. Petraeus visited the U.S. Embassy in Tripoli, the Libyan capital, less than two weeks ago for talks with the CIA station chief and other officials.

Lawmakers are likely to question whether Broadwell was improperly given access to sensitive information about the attack. In a late October speech at the University of Denver, she said that the CIA annex where two of the Americans were killed “had actually taken a couple of Libyan militia members prisoners” and that the attack was thought to be “an effort to get them back.” U.S. officials have not made reference to that possible motive in numerous accounts of the Benghazi attack.

A CIA spokesperson called the suggestion that the agency keeps prisoners in Libya “uninformed and baseless,” in a statement issued Sunday night. “The CIA has not had detention authority since 2009,” it said.

The administration has said that Mike Morell, Petraeus’s deputy and now acting CIA director, will testify for the agency.

Sen. Lindsey O. Graham (R-S.C.) suggested on CBS’s “Face the Nation” the formation of a joint select committee of the House and Senate, similar to those convened to investigate the Watergate and Iran-contra.

Graham also said he would oppose the selection of the U.S. ambassador to the United Nations, Susan F. Rice, to succeed Hillary Rodham Clinton as secretary of state. Rice has been on the shortlist for the post. Days after the Benghazi attack, now labeled a terrorist assault by the administration, Rice said that the assault grew out of a protest march that had turned violent.

Greg Miller, Ernesto Londoño, Julie Tate and Bob Woodward contributed to this report.