Like Clinton, Petraeus had a leadership role in the administration during the Benghazi attack and people within his command were killed; he was involved in a headline-grabbing intelligence handling scandal; and he even kept a serious illness under wraps from the public.
Here's a look at how David Petraeus has had the same pitfalls as Hillary Clinton during her race against Donald Trump.
Mishandling Classified Information
By now we all know Clinton's story: During her tenure as secretary of state, she used a private email server to conduct official business and, according to an FBI investigation, at times sent or received classified information. Clinton had maintained that what she did was permitted and ultimately the FBI concluded that though her actions were "careless," they did not amount to a crime.
Petraeus, however, got himself into a situation where he eventually pleaded guilty to a misdemeanor federal charge of mishandling classified information, leading to his resignation as the director of the CIA.
And according to the federal indictment, he lied to investigators about possessing the books and sharing them with his biographer.
Trump has said that Petraeus got into trouble for doing far less than Clinton when it comes to handling classified info. For example, on July 5, after the FBI announced it would not recommend Clinton be charged, Trump tweeted, "The system is rigged. General Petraeus got in trouble for far less. Very very unfair! As usual, bad judgment."
But FBI Director James Comey has disagreed with Trump on that.
In that announcement from Comey on July 5, he said, "Although we did not find clear evidence that Secretary Clinton or her colleagues intended to violate laws governing the handling of classified information, there is evidence that they were extremely careless in their handling of very sensitive, highly classified information."
"Although there is evidence of potential violations of the statutes regarding the handling of classified information, our judgment is that no reasonable prosecutor would bring such a case," Comey added. "Prosecutors necessarily weigh a number of factors before bringing charges. There are obvious considerations, like the strength of the evidence, especially regarding intent."
And on July 7, during a hearing of the House Oversight Committee, Comey was asked to compare the Petraeus and Clinton cases.
"No, it's the reverse," Comey said.
“His conduct, to me, illustrates the categories of behavior that mark the prosecutions that are actually brought," the FBI director added. "Clearly intentional conduct -- knew what he was doing -- was a violation of the law. Huge amounts of information that even if you couldn't prove he knew it, it raises the inference that he did it in an effort to obstruct justice. That combination of things makes it worthy of a prosecution. A misdemeanor prosecution, but a prosecution nonetheless.”
Like Clinton, Petraeus had a senior leadership role overseeing U.S. personnel in Benghazi in September 2012, when terrorist attackers killed four Americans, including the U.S. ambassador to Libya. And like many Republicans, Trump has been heavily critical of the Obama administration's response to those attacks. He even invited the Benghazi survivors Mark Geist and John Tiegen to speak at July's Republican National Convention.
But during congressional investigations into the terror attacks, Petraeus denied many of the Benghazi narratives embraced by Trump and those who attacked Clinton.
He denied the narrative that there was a “stand down” order given to CIA security agents who wanted to save the ambassador and also dismissed accusations that the CIA was involved a “gun running” mission to send Libyan arms to ISIS militants in Syria -- two leading conspiracy theories embraced by Trump.
Trump has tweeted about the unsubstantiated “gun running” theories. In August 2014, he tweeted that "Obama sent weapons through Benghazi to ISIS," and in October 2012, he wrote, "I bet the terrorists in Libya used weapons we supplied them during their so called 'revolution' to attack our embassy in Benghazi."
Any covert mission such as that would have been conducted while Petraeus was in charge of the CIA.
Also, former Rep. Mike Rogers, R-Michigan, reportedly stepped down from the Trump transition team because, according to CBS News, of the House Intelligence Committee report he co-authored in November 2014 that exonerated Clinton.
In February 2009, Petraeus, then head of U.S. Central Command, was diagnosed with prostate cancer, but kept the illness private for eight months and released a statement only after being asked questions by the press.
In a statement he released at the time, Petraeus said he was treated successfully and considered it a private matter that did not interfere with his duties.
Just over a year later, while he was commander of Coalition forces in Afghanistan, Petraeus momentarily fainted while being questioned by Sen. John McCain during a Senate Armed Services Committee hearing.
Clinton's health was a recurring talking point for Trump during his campaign. Clinton's pneumonia, which was not initially disclosed, and subsequent fainting spell during her presidential campaign was exploited by candidate Trump. Trump once imitated Clinton's fainting, often saying she needed rest and didn’t have the stamina and energy to be president.
“She’s supposed to fight all of these different things, and she can’t make it 15 feet to her car. Give me a break,” Trump said, just before acting out his own fainting spell at a campaign event in Manheim, Pennsylvania, on Oct. 1.