Outgoing CIA Director Gen. David Petraeus’ resignation over an extramarital affair was reportedly held until after Tuesday’s election to avoid “potential embarrassment” for President Barack Obama, according to Newsmax.

FBI agents learned of the affair while monitoring Petraeus’ emails out of concern that the woman, Petraeus biographer Paula Broadwell, may have had access to his personal account, the Associated Press reported.

But an FBI source told Ronald Kessler, the author and journalist who broke the Secret Service prostitution scandal, that rather than having Petraeus resign immediately, the decision was made to hold it until after the election for political purposes:

[T]he White House, with concurrence by the FBI and Justice Department, held off on asking for Petraeus’ resignation until after the election. His resignation occurred three days after the election, avoiding the possibility that Obama’s ill-fated appointment of Petraeus could become an issue in the election.

FBI agents on the case were aware that such a decision had been made to hold off on forcing him out until after the election and were outraged.

“The decision was made to delay the resignation apparently to avoid potential embarrassment to the president before the election,” an FBI source says. “To leave him in such a sensitive position where he was vulnerable to potential blackmail for months compromised our security and is inexcusable.”

Michael Kortan, the FBI’s assistant director for public affairs, said he had no comment.

The precise timeline of the FBI investigation and discovery of the affair is still unclear. The Wall Street Journal reported that the email investigation began “late this spring” but that Petraeus wasn’t interviewed until “recently.”

Despite Kessler’s report that the White House “held off” on asking for Petraeus to step down until after the election, the Associated Press reported that administration officials were first notified of the affair on Wednesday, the day after the election, and that Obama wasn’t informed until Thursday morning.

Efforts to contact the FBI’s national press office Saturday were unsuccessful.

​RELATED: