One day after President Trump's former attorney, Michael Cohen, was sentenced to three years in prison for a variety crimes, Trump took to Twitter to address alleged campaign finance violations Cohen says he engaged in at Trump's direction.

Cohen flipped on Trump after federal agents raided his office and home in April, later making the remarkable claim that Trump directed him to pay off two women who claimed to have had affairs with the president in order to prevent their allegations from influencing the 2016 US election. The payments included $130,000 to porn star Stephanie Clifford (Stormy Daniels), while Cohen also orchestrated a $150,000 payment to a former Playboy playmate through the National Enquirer's parent company, American Media Inc. (AMI).

Trump, who initially denied knowing about the payments but later acknowledged that he had known about them, insisted this week that they were "a simple private transaction," and not related to the election - and therefore would not be subject to campaign finance laws.

On Thursday, Trump took to Twitter to defend himself and lash out at Cohen in a three-part tweetstorm - claiming Cohen had an obligation to know the law, and that his former personal attorney had pleaded guilty in order to embarrass him and receive a reduced sentence.

"I never directed Michael Cohen to break the law," Trump said. "He was a lawyer and he is supposed to know the law. It is called “advice of counsel,” and a lawyer has great liability if a mistake is made. That is why they get paid. Despite that many campaign finance 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. Cohen was guilty on many charges unrelated to me, but he plead to two campaign charges which were not criminal and of which he probably was not guilty even on a civil bases [sic]. Those charges were just agreed to by him in order to embarrass the president and get a much reduced prison sentence, which he did-including the fact that his family was temporarily let off the hook. As a lawyer, Michael has great liability to me!"

I never directed Michael Cohen to break the law. He was a lawyer and he is supposed to know the law. It is called “advice of counsel,” and a lawyer has great liability if a mistake is made. That is why they get paid. Despite that many campaign finance lawyers have strongly...... — Donald J. Trump (@realDonaldTrump) December 13, 2018

....stated that I did nothing wrong with respect to campaign finance laws, if they even apply, because this was not campaign finance. Cohen was guilty on many charges unrelated to me, but he plead to two campaign charges which were not criminal and of which he probably was not... — Donald J. Trump (@realDonaldTrump) December 13, 2018

....guilty even on a civil basis. Those charges were just agreed to by him in order to embarrass the president and get a much reduced prison sentence, which he did-including the fact that his family was temporarily let off the hook. As a lawyer, Michael has great liability to me! — Donald J. Trump (@realDonaldTrump) December 13, 2018

Hours after Cohen's guilty plea, American Media Inc. admitted responsibility for its role in a $150,000 "catch-and-kill" hush money payment to former Playboy model Karen McDougal, which Cohen negotiated, to keep the story out of the public sphere "and prevent it from influencing the election."

According to AMI's cooperation agreement with federal prosecutors, Cohen and another campaign official met with AMI Chairman and longtime Trump friend David Pecker about the payment around August 2015.

The company initially said they paid McDougal $150,000 for two years' worth of her fitness columns, magazine covers and exclusive life rights to any relationship she has had with a then-married man, only to walk that back Wednesday afternoon.