Critics yesterday questioned the timing of David Petraeus’ stunning resignation as CIA chief just two days after the presidential election.

Top spook Petraeus resigned after an FBI investigation that took so long that some in Congress wondered how President Obama could not have known about this until Thursday, when aides say he was finally briefed on the matter.

“To carry on an investigation of the CIA director that long, the FBI would have had to think it was serious — and if it was serious, they would have had to tell the president,” said Rep. Peter King (R-LI), chairman of the house Committee on Homeland Security.

“It’s hard to believe that the investigation was going on for six months and nothing serious happened until after the election,” King said. “The whole thing just doesn’t add up.”

Members of the House and Senate Intelligence committees didn’t learn of the affair and Petraeus’ resignation until Friday.

“The intelligence committees are pretty annoyed that they didn’t hear about this at all,” said one former Senate GOP aide.

House intelligence committee chairman Mike Rogers (R-Mich.) and ranking member Dutch Ruppersberger, (D-Md.) will meet Wednesday with FBI and CIA officials to ask questions about the investigation, a source said.

Petraeus and his aides were already in hot water with some in Congress over the Obama administration’s alleged bungling of the Sept. 11 attack on the US Consulate in Benghazi, Libya, where Ambassador Christopher Stevens and three other Americans were killed.

The new acting director of the CIA, Michael Morell, is expected to testify — instead of Petraeus — at congressional hearings scheduled for Thursday.