A presidential candidate uses other people’s money to pay off an alleged mistress to keep her story out of the press in the runup to an election. Federal prosecutors later deem the payments illegal campaign contributions and file criminal charges.

The candidate was former Sen. John Edwards and the year was 2008. Edwards had fathered a child with his mistress, Rielle Hunter, and he used more than $900,000 in donations from political allies to try to keep the affair secret.

In 2011, Edwards was indicted by the Department of Justice for allegedly violating campaign finance laws by accepting contributions in excess of legal limits, using them to cover Hunter’s living expenses, and concealing the funds from the Federal Election Commission. Prosecutors claimed he made the payments because revealing the affair would undermine his public image and sink his campaign.

In 2016, Michael Cohen, then a personal attorney for Republican nominee Donald Trump, arranged a payment from a tabloid to an alleged mistress of his client to bury her story and paid another alleged mistress himself to silence her. Cohen pleaded guilty to violating campaign finance laws, and prosecutors say he was directed to do so by Trump.

President Trump has not been charged with a crime, and he maintains he did nothing illegal. Edwards was not convicted of his charges, a precedent current Trump attorney Rudy Giuliani says bolsters his defense that he did not violate the law, but some legal experts believe that comparison is flawed.

“There are certainly parallels. It’s the same substantive areas of campaign finance laws but there are very important factual distinctions that make the case against team Trump much stronger,” alleged Paul S. Ryan, vice president for policy and litigation at Common Cause, an advocacy group that has filed complaints with the FEC and the Department of Justice over the Trump payments.

Both cases turn on the same underlying question: are hush money payments to alleged mistresses campaign-related expenses? According to Michael Kang, a professor at Northwestern’s Pritzker School of Law, it is plausible in both instances that candidates were motivated by personal concerns instead of political ones, but Cohen has admitted he was trying to protect Trump’s campaign.

“One massive difference is here you have Cohen testifying he did something illegal,” Kang said.

The National Enquirer blew the lid off the Edwards affair in late 2007, and other media outlets continued pursuing the story even after he dropped out of the 2008 presidential race. He initially denied the affair but eventually admitted it, and he insisted he covered it up to save his marriage rather than his campaign.

In Trump’s case, it was the Enquirer that helped cover up an alleged affair. American Media Inc., the tabloid’s publisher, paid model Karen McDougal $150,000 to quash her claim of an affair with Trump, and an immunity agreement with federal prosecutors released Wednesday states the company did so “to suppress the woman's story so as to prevent it from influencing the election.”

Cohen has pleaded guilty to “causing an unlawful campaign contribution” for facilitating that deal. Separately, he paid adult film actress Stormy Daniels $130,000 to stay quiet about her alleged sexual encounter with Trump. Prosecutors say the Trump Organization disguised Cohen’s reimbursement for that payment as part of his monthly retainer for legal services.

“I think the facts are stronger for the government in the Trump case than the Edwards case, but it would have been hard to prove the case without Cohen’s cooperation here,” Kang said.

The timelines of the two cases also differ. Edwards’ payoffs to Hunter were contemporaneous with their affair and began before he launched his campaign, while Trump’s came years after the alleged sexual encounters in the final months of the race when they were trying to go public.

“The payments made to Karen McDougal and Stormy Daniels were in August and October of the election year. That proximity is evidence of whether the payment was to influence the election,” Ryan claimed.

The Daniels payment in particular could prove difficult to divorce from the campaign. It came in the weeks after a 2005 recording of Trump seemingly bragging about sexual assault was released and while American voters were making final decisions.

“It seems like Cohen and Trump were more worried about this in October and it would be natural to assume it was related to the election,” Kang said, though he added prosecutors would need to prove the payment would not have been made if Trump was not running for president.

Edwards acknowledged making the payments to Hunter, but his defense attorneys argued he had no idea the money provided by wealthy donors could be considered campaign contributions. Edwards was acquitted on one count, but the jury deadlocked on the remaining charges. Prosecutors opted not to retry him, but Ryan argued that decision does not prove he did nothing wrong.

“He was tried on 6 counts,” Ryan said. “He was acquitted on one and there was a hung jury on the other five counts, which is far from a vindication.”

“I never directed Michael Cohen to break the law. He was a lawyer and he is supposed to know the law,” the president tweeted.

In the past, prosecutors have been hesitant to file campaign finance charges against candidates who did not know the expenditures violated the law, and Kang said it is possible Trump did not know the law was being broken.

“Usually ignorance of the law is not a defense as a general matter, but I believe for this statute the way it’s been treated is you have to know it’s a violation,” he said.

Trump was dismissive of the Edwards case at the time of the trial, tweeting in April 2012, “I have never been a fan of John Edwards but it is time for the gov't to focus on more important things.” That statement could be construed as evidence Trump knew payments to an alleged mistress were possible criminal violations.

On Wednesday, the U.S. Attorney’s Office for the Southern District of New York, which handled Cohen’s prosecution, released a non-prosecution with American Media Inc. stating that company assisted the campaign in finding women who had damaging stories about Trump “so they could be purchased and their publication avoided.”

AMI’s admission that it suppressed McDougal’s story explicitly to protect Trump’s campaign might further complicate the Edwards parallel.

“In this matter, the two sources of the payment, Michael Cohen and AMI, have both acknowledged to the DOJ the purpose of their payments to these women were to influence the election,” Ryan said.

AMI’s cooperation also means Cohen—whose credibility is questionable since he has admitted lying to Congress—would not be the only witness against Trump if prosecutors do attempt to pursue charges against him. In the Edwards case, one of the donors had died and the other was over 100 years old and unable to travel to testify, so no witnesses could personally attest to their motives.

An important caveat to all of this is that the public does not know all the cards prosecutors hold. AMI’s agreement was secret until Wednesday afternoon, and they could be keeping additional evidence confidential. Cohen’s sentencing documents indicate investigators have recordings of multiple relevant conversations, but prosecutors did not detail what led them to conclude Cohen acted “in coordination with and at the direction of” Trump.

“Based on my experience in the SDNY, I am confident that prosecutors would not have included this conclusive sentence in their sentencing submission if they did not have sufficient evidence to corroborate Cohen and charge Trump with the same crimes to which Cohen pled guilty,” former New York federal prosecutor Daniel Goldman said in a NBC News op-ed.

As Trump tweeted Wednesday, other campaign finance law experts agree he did not break the law, and they say Cohen might not have either, despite his guilty plea.

“In short, Michael Cohen is pleading guilty to something that isn’t a crime. Of course, people will do that when a zealous prosecutor is threatening them with decades in prison. But his admissions are not binding on President Trump, and Trump should fight these charges ferociously,” wrote former FEC Chairman Bradley Smith in the National Review.

Smith claimed the allegations rest on an overly broad interpretation of using funds “for the purpose of influencing an election” that would arguably make feeding and grooming oneself campaign expenses.

“A candidate may intend for good toothpaste and soap, a quality suit, and a healthy breakfast to positively influence his election, but none of those are campaign expenditures, because all of those purchases would typically be made irrespective of running for office,” he said.

According to Hans von Spakovsky, a senior legal fellow at the Heritage Foundation, the payments to McDougal and Daniels should not be considered campaign contributions because a “celebrity” like Trump would readily make such expenditures to protect his reputation regardless of whether he was campaigning for office.

“These payments were relatively small given Trump’s net worth—the kind of nuisance settlement that celebrities often make to protect their reputations, especially when faced with claims that will cost far more to defend than making a quick payoff without all of the bad publicity that usually accompanies such cases,” he wrote in the Daily Signal.

Von Spakovsky also argued the Justice Department misinterpreted election law when it charged Edwards, noting that an FEC audit determined the payments to Hunter were not campaign expenses and did not need to be reported. Edwards had two former FEC chairmen prepared to testify they would not consider the funds campaign expenses either.

“The testimony of government witnesses makes it pretty clear that the payments by these donors would not have been made if Edwards had not been running for office,” he wrote at the time. “Edwards is a multimillionaire; he could easily have afforded to make the payments (including legally obligated child support) out of his personal funds. But such personal payments would have blown up his candidacy and made it impossible to hide what he clearly wanted to keep hidden.”

One significant distinction between the two cases currently working in Trump’s favor is that he is the president. The Department of Justice is currently operating under guidance that a sitting president cannot be indicted, and the statute of limitations on campaign finance violations is five years. If Trump is re-elected in 2020, his presidency will run well beyond the five-year limit and the legal debate will be moot, but prosecutors could conceivably charge him in 2021 if he loses.

The political fallout from the latest revelations is also unclear. Edwards’ career never recovered from his scandal, but Trump’s support is remarkably resilient. Democrats are already talking about the campaign finance violations as potential evidence for impeachment, but Republicans on Capitol Hill have largely shrugged them off.

“It looks like Michael Cohen did some bad things. He pleaded guilty to some bad things,” Rep. Glenn Grothman, R-Wis., said Wednesday. “We’ll just have to see what plays out.”