President Donald Trump’s former attorney, Michael Cohen, may have been convinced by the Office of the U.S. Attorney for the Southern District of New York to plead guilty to a supposed violation of campaign finance law, but that doesn’t mean that what happened is actually a federal crime.

In fact, neither the Federal Election Commission—which is the independent agency tasked with enforcing the Federal Election Campaign Act—nor its former commissioners would likely agree with the overaggressive view that the Southern District is taking. Indeed, the Southern District’s aggressive stance on this issue might have violated the Justice Department’s own policy.

Robert Khuzami, the acting U.S. attorney standing in for Geoffrey Berman, who has recused himself from the Cohen case, says in the government’s sentencing memorandum that Cohen committed a campaign finance violation by arranging payments from corporations to two women—Woman-1 and Woman-2 (Karen McDougal and Stormy Daniels, respectively), who claimed they had affairs with Trump—in order to buy their silence. Cohen eventually invoiced the Trump Organization for the Daniels payment.

Khuzami asserts these were illegal corporate contributions to the Trump campaign because they were made with “the intent to influence the 2016 presidential election.” Thus, he claims, they were campaign-related expenses and all of the rules governing federal campaigns apply to the payments.

But there are numerous problems with Khuzami’s claim.

First, his theory that anything intended to “influence” an election is a campaign-related expense fails to take into account the statutory limitation on this definition. FECA (52 U.S.C. 30114 (b)(2)) specifically says that campaign-related expenses do not include any expenditures “used to fulfill any commitment, obligation, or expense of a person that would exist irrespective of the candidate’s election campaign.”

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. Given Trump’s celebrity status, the potential liability to these women existed “irrespective of the candidate’s election campaign.”

As Trump’s lawyer, Rudy Giuliani, has said, the payment to Daniels was made “to resolve a personal and false allegation in order to protect the president’s family” and “it would have been done in any event, whether he was a candidate or not.”

>>> Rudy Giuliani Is Right: Settlement With Stormy Daniels Didn’t Violate Campaign Finance Law

On the one previous occasion that the Justice Department tried to argue that hush money payments to a mistress were a “campaign-related” expense, a jury also did not appear to buy the government’s theory. In the unsuccessful prosecution of former Democratic presidential candidate John Edwards, campaign donors made payments to Edwards’ mistress, Rielle Hunter, a videographer who was actually working on his presidential campaign.

Unlike Daniels and McDougal, Hunter was paid $1 million while directly working for the campaign and Edwards. Her payments did not go through the Edwards campaign’s account, but the government tried to claim they were campaign expenditures because they were intended to protect Edwards’ reputation during his presidential run and thus “influence” the election.

Yet a jury acquitted Edwards on the charge of accepting an illegal campaign donation and failed to reach a verdict—resulting in a mistrial—on the other charges, which included filing false reports with the Federal Election Commission for not listing the payments to his mistress.

The fact that a jury did not convict Edwards would not ordinarily mean that the government did not have a viable claim that a defendant violated the law. But consider this. Edwards had two former chairmen of the Federal Election Commission on retainer—Scott Thomas and Robert Lenhard—who were prepared to testify that, in their opinion, such payments to a mistress are not campaign-related expenses. Brad Smith, another former chairman of the commission, has similarly said that the hush money paid by Cohen is not a campaign-related expense.

So the government in the Edwards prosecution was unable to convince the jury that these were campaign-related expenses covered by federal campaign finance law. The Justice Department subsequently dropped its prosecution and never retried Edwards—in part, no doubt, because many other campaign finance experts called the case “legally flawed,” according to a Politico report in 2012.

And this wasn’t just their opinion—it was also the opinion of the Federal Election Commission. How do we know? Because as the chief financial officer for the Edwards campaign testified, when the Federal Election Commission audited the campaign, it determined that these payments were not campaign-related expenses that needed to be reported or run through the campaign. Thus, the commission said the federal rules governing campaign contributions and expenditures did not apply.

It is true that Justice Department prosecutors are not necessarily bound by the commissioners’ interpretation of the Federal Election Campaign Act. But according to the Justice Department handbook on election crimes, “Federal Prosecution of Election Offenses,” the prosecution of all campaign finance crimes must be coordinated with the Public Integrity Section of the Criminal Division in Washington, D.C.

No investigation or indictment can occur without a U.S. attorney first consulting with the Public Integrity Section, according to the handbook. In fact, this rule is set forth in the U.S. Attorneys’ Manual of DOJ (Sec. 9.85.210).

The long-time head of the Election Crimes Unit within the Public Integrity Section, who was the final word on all campaign finance prosecutions at the Justice Department before he retired, was Craig Donsanto. He wrote the handbook still used by federal prosecutors.

In a letter on Jan. 16, 2009, from Donsanto to Citizens for Responsibility and Ethics in Washington (CREW), Donsanto explained why the Justice Department would not be opening an investigation of the U.S. Chamber of Commerce over accusations that it had made illegal corporate contributions.

As Donsanto said, the role of the Justice Department in prosecuting cases under the Federal Election Campaign Act is “confined to prosecuting violations of the act’s provisions that are committed ‘knowingly and willfully.’” For a criminal violation to occur, “the application of the law to the facts of a matter must at the very least be clear, and there must be no doubt that the [Federal Election] Commission considers that the underlying conduct presents a [Federal Election Campaign Act] offense. That is not the case here.”

That is also not the case here regarding Cohen. As the Edwards case shows, the Federal Election Commission does not consider payments made to a mistress to be expenditures covered by the federal campaign law, and there is nothing in the public record to suggest that the commission has changed its mind since then. It is therefore unlikely that the prosecutors in this case followed the Justice Department’s own policy with respect to charging decisions in this area.

Just as important is Donsanto’s point about a “knowing and willful” violation of the law. That requires proof that a defendant clearly intended to violate the law.

How can Cohen or anyone else involved in these payments be charged with a “knowing and willful” violation of the law by facilitating these payments when numerous campaign finance lawyers, federal election commissioners, and the Federal Election Commission itself have all publicly opined that such payments do not violate the law in the first place?

Some Democrats such as Rep. Jerrold Nadler, D-N.Y., are claiming that these supposed violations of campaign finance law are an impeachable offense. Apparently, they didn’t believe that the $375,000 civil penalty paid by Barack Obama’s 2008 campaign for campaign finance violations—one of the largest in the commission’s history—was an impeachable offense.

Some are saying that what the Obama campaign did was a civil violation, not a criminal violation. But as I have just explained, there is a strong argument that the payments made by Cohen were not violations of the law at all, civil or criminal.

By the way, if Khuzami’s legal theory is correct—that any payments made to settle such a claim are campaign-related expenditures because they are intended to protect the reputation of a candidate and thus influence the election—a lot of members of Congress are in potential trouble. Last year, it was reported that Congress has secretly paid out over $17 million to settle close to 300 cases by staffers claiming sexual and other forms of harassment and discrimination.

Such payments are obviously being made—in secret—to protect the reputations of senators and congressmen, many of whom will and have run for re-election. Does this mean that they are using taxpayer funds to pay campaign expenses? Is Khuzami going to open up investigations of all these settlements and all these members of Congress?

It seems pretty clear that the Federal Election Campaign Act wasn’t meant to cover what Cohen has pleaded guilty to, which is why the Edwards prosecution failed. It is also highly doubtful that if this case had been presented to the Federal Election Commission, where I used to serve as a commissioner, it would find a violation of the law.

No one can excuse the tax evasion and financial fraud charges to which Cohen has pleaded guilty. And as former Federal Election Commission Chairman Brad Smith recently said, we can probably all agree that these “payments to women were unseemly.”

But “that doesn’t mean they were illegal,” says Smith, regardless of the fact that the Southern District of New York convinced Cohen to plead guilty.