Donald Trump has denied directing his ex-lawyer Michael Cohen to break the law.
Cohen was jailed for three years on Wednesday after admitting crimes including tax evasion, lying to Congress and arranging illicit payments to silence women who threatened Mr Trump's presidential campaign in 2016.
The president tweeted: "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."
Pleading for leniency in a packed Manhattan courtroom before US District Court Judge William H Pauley III, Cohen said he had been led astray by misplaced admiration for the president.
The 52-year-old told the court he accepted responsibility for his personal crimes and "those involving the President of the United States of America".
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
Cohen admitted in August that during Mr Trump's presidential campaign he made a $130,000 payment to porn star Stormy Daniels and arranged for a $150,000 payment to former Playboy model Karen McDougal.
Ms Daniels and Ms McDougal each claim to have had affairs with Mr Trump in 2006.
The president said legal experts had cleared him of any wrongdoing and repeated his denial that he had broken campaign finance laws.
He argued that Cohen's crimes did not involve campaign finance.
Mr Trump tweeted: "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.
"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!"
More from Donald Trump

Cohen admitted charges brought by federal prosecutors in New York of tax evasion, providing false statements to a bank and illegal campaign contributions.
He also admitted making false statements to Congress – a charge stemming from Special Counsel Robert Mueller's probe into whether Mr Trump's campaign colluded with Russia to get him elected.
Donald Trump has denied directing his ex-lawyer Michael Cohen to break the law.
Cohen was jailed for three years on Wednesday after admitting crimes including tax evasion, lying to Congress and arranging illicit payments to silence women who threatened Mr Trump's presidential campaign in 2016.
The president tweeted: "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."
Pleading for leniency in a packed Manhattan courtroom before US District Court Judge William H Pauley III, Cohen said he had been led astray by misplaced admiration for the president.
The 52-year-old told the court he accepted responsibility for his personal crimes and "those involving the President of the United States of America".
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
Cohen admitted in August that during Mr Trump's presidential campaign he made a $130,000 payment to porn star Stormy Daniels and arranged for a $150,000 payment to former Playboy model Karen McDougal.
Ms Daniels and Ms McDougal each claim to have had affairs with Mr Trump in 2006.
The president said legal experts had cleared him of any wrongdoing and repeated his denial that he had broken campaign finance laws.
He argued that Cohen's crimes did not involve campaign finance.
Mr Trump tweeted: "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.
"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!"
More from Donald Trump

Cohen admitted charges brought by federal prosecutors in New York of tax evasion, providing false statements to a bank and illegal campaign contributions.
He also admitted making false statements to Congress – a charge stemming from Special Counsel Robert Mueller's probe into whether Mr Trump's campaign colluded with Russia to get him elected.