President Donald Trump seems to misunderstand the nation's campaign-finance laws, judging by his comments in a Fox News interview.

The president may have inadvertently admitted to a crime as a result.

President Donald Trump came very close to outright saying he committed a federal crime during a Fox News interview aired Wednesday, and that may stem from a lack of understanding of the nation's campaign-finance laws.

During his interview with "Fox and Friends" host Ainsley Earhardt, Trump was asked if he knew of the payments to former Playboy model Karen McDougal and adult-film star Stormy Daniels ahead of the 2016 presidential election. Earhardt's question came after Trump's former longtime lawyer, Michael Cohen, said under oath in federal court that Trump directed him to knowingly break the law to boost his own candidacy by paying off those women to keep silent allegations of affairs.

"Later on I knew," Trump said. "Later on. But you have to understand, Ainsley, what he did — and they weren't taken out of campaign finance. That's a big thing. That's a much bigger thing. Did they come out of the campaign? They came from me. I tweeted about it. I don’t know if you know, but I tweeted about the payments. But they didn’t come out of the campaign. In fact, my first question when I heard about it was, 'Did they come out of the campaign?' Because that could be a little dicey. They didn't come out of the campaign, and that's big. It's not even a campaign violation."

Cohen was charged with a pair of campaign-finance violations stemming from those payments, which the government viewed as improper, as part of a plea deal he worked out with prosecutors. Cohen explained that he committed the campaign-finance violations "at the direction of the candidate" and with the "purpose of influencing the election."

The attorney said that, at Trump's direction, he moved to keep both McDougal and Daniels, whose real name is Stephanie Clifford, from publicly disclosing damaging information that would hurt Trump's campaign.

McDougal's story of an affair with Trump was purchased by American Media Inc., whose head, David Pecker, is a longtime friend of Trump. The National Enquirer, which is owned by AMI, purchased the rights to McDougal's story for $150,000 in August 2016 but never published it. That practice is known as "catch and kill."

And just days before the 2016 presidential election, Cohen facilitated a $130,000 payment to Daniels to keep her quiet about her allegation of having a 2006 affair with Trump — an allegation Trump has denied.

Prosecutors wrote that they could back up Cohen's admissions through evidence obtained from the FBI's April raids on Cohen's home, office, and hotel room that included documents, electronic devices, audio recordings, text messages, messages sent on encrypted apps, phone records, and emails.

The payments don't have to come from Trump's campaign to be a campaign-finance violation

Based on Trump's interview on Fox, he seems to think that a campaign-finance violation would have occurred if campaign funds were used to pay off Daniels and McDougal, rather than his personal cash, which was used to reimburse Cohen for the initial Daniels payment. The reverse of this is true, as The Huffington Post first reported.

If Trump had routed money through his campaign to pay off women, it would be legal. Campaigns can spend unlimited amounts of money. The problem would have been that if Trump did use his campaign to pay off any women, it would have defeated the purpose of making the payment, which was to ensure silence. Such an expenditure would have had to be reported to the Federal Election Commission and publicly disclosed.

Cohen, meanwhile, pleaded guilty to making an excessive contribution far beyond the legal limit. And if the McDougal deal was made to help boost Trump's campaign, which was the case, according to Cohen's testimony, that too is an excessive contribution. Neither was reported by the campaign, though the purpose of the donations was to benefit it, Cohen said.

Trump first disclosed his reimbursement to Cohen, which came in the form of a retainer that was paid out throughout 2017, on his latest financial disclosure report earlier this year.

Cohen's guilty plea hurts Trump's best defense

Trump's best defense is one that Cohen claimed was true earlier this year, and one that Trump's personal attorney, Rudy Giuliani, has also latched onto: That the arrangement was made not to boost Trump's candidacy but to shield his family, particularly his wife, Melania Trump, from the embarrassing information. That argument was what helped former Democratic Sen. John Edwards of North Carolina in a similar case.

But Cohen's testimony, backed up by what the government says is evidence that corroborates it, hurts that narrative.

Trump made another claim in the Fox interview, and on Twitter, regarding campaign-finance law, saying that his predecessor, former President Barack Obama, "had a massive campaign violation" that did not end up leading to similar charges. To Trump, this seems outrageously unfair.

The president was referring to a nearly $400,000 fine levied against Obama's 2008 campaign by the FEC for failing to file reports near the end of the election sprint and for failing to properly refund excessive contributions under a strict timeframe.

As The Huffington Post wrote, that fine remains the largest the FEC has ever issued. But there is a major distinction between that case and Cohen's crimes. That has to deal with having "knowingly and willfully" violated campaign-finance law, which is the standard for such a violation being criminal. Without a violation meeting that standard, it is viewed as a civil infraction.