President Donald Trump continued to claim he did nothing wrong when he made illegal hush-money payments to two women who said they had affairs with him — even as federal prosecutors said at least one payment was made in coordination with his 2016 presidential campaign.

In a series of tweets one day after Michael Cohen was sentenced to federal prison, Trump denied violating campaign finance laws and blamed his former longtime personal attorney for giving him bad legal advice.

Cohen was sentenced to three years in federal prison on Wednesday after he implicated Trump in the hush-money payment scandal. He pleaded guilty in August to two counts of campaign finance violations, tax evasion and making false financial statements, and said he worked at Trump’s direction to pay off former Playboy model Karen McDougal and adult film star Stormy Daniels to keep them quiet about their alleged affairs with Trump. Cohen said the payments were made to exert influence on the 2016 election.

Also on Wednesday, the U.S. Attorney’s Office for the Southern District of New York said it reached a plea deal with American Media Inc., the parent company of the National Enquirer, which said it paid McDougal $150,000 “in concert with a candidate’s presidential campaign.” The National Enquirer had agreed to pay McDougal for her story about Trump prior to the 2016 election, but never published it.

While AMI previously denied making the payment to kill a story that could cause damage to Trump, prosecutors said Wednesday that the company had admitted that “its principal purpose in making the payment was to suppress the woman’s story as to prevent it from influencing the election.”

Trump, who has denied the affairs with both women and called the payments “a simple private transaction,” continued to falsely claim that the payments had nothing to do with campaign finance. Cohen pleaded guilty to campaign finance violations in relation to the payments.

“Despite that many campaign lawyers have strongly stated that I did nothing wrong with respect to campaign finance laws, if they even apply, because this was not campaign finance,” he tweeted.

Trump said Cohen pleaded guilty on counts of campaign finance violation to “embarrass the president and get a much reduced prison sentence” — and was not an indication that anything illegal happened.

Later on Thursday, Trump doubled down on his comments in an interview with Fox News, saying again that Cohen’s payments were not a campaign finance violation.

“What he did was all unrelated to me except for the two campaign finance charges that are not criminal and shouldn’t have been on there,” he said. “They put that on to embarrass me.”

Trump also addressed the case of his former national security adviser Michael Flynn, who last year pleaded guilty to lying to the FBI and has since given enough information to assist special counsel Robert Mueller’s Russia investigation that prosecutors recommended he should not serve prison time.

Trump told Fox that FBI agents pushed Flynn to plead guilty about providing false statements regarding his contacts with the Russian ambassador and recommended he not be sent to prison because “they are embarrassed that they got caught.”

“Maybe they scared him enough that he’ll make up a story but I have a feeling that maybe he didn’t,” he said. “He’s a tougher kind of guy than Cohen.”

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Mahita Gajanan at mahita.gajanan@time.com.