A federal judge in New York sentenced Michael Cohen, President Donald Trump’s longtime lawyer, to three years in prison Wednesday for crimes including tax evasion, making hush-money payments, and lying to Congress about past business dealings in Russia.

U.S. District Judge William Pauley III said he will allow Cohen to voluntarily surrender to prison on March 6 and ordered the former Trump lawyer to pay a $50,000 fine for making false statements to lawmakers. Cohen must also pay a forfeiture of $500,000 and $1.4 million in restitution. Prior to sentencing Cohen, Pauley told the courtroom that the former Trump lawyer pled guilty to a “veritable smorgasbord of fraudulent conduct.” Further, Pauley said that Cohen “appears to have lost his moral compass” and that he “should have known better” than to dodge taxes, lie to Congress and violate campaign finance laws.

Addressing the courtroom before his sentencing, Cohen took aim at the president for branding him as “weak” in a recent tweet, saying that his weakness was blind loyalty to his former boss. “Recently, the President tweeted a statement calling me weak, and it was correct, but for a much different reason than he was implying,” an emotional Cohen said. “It was because time and time again, I felt it was my duty to cover up his dirty deeds.”

Under federal sentencing guidelines, Cohen previously stood to receive approximately four years in prison, while his lawyers had argued for leniency.

The former Trump lawyer pleaded guilty to misleading Congress about his work on a proposal to build a Trump Tower in Moscow, making false statements about when discussions with Russia about a possible deal concluded. Cohen also pleaded guilty in August to breaking campaign finance laws by helping orchestrate payments to silence former Playboy model Karen McDougal and pornographic actress Stormy Daniels, who alleges to had sexual encounters with Trump before he was president.

Daniels’ disgraced lawyer, Michael Avenatti, also turned up for Cohen’s sentencing. Avenatti represented Daniels in a legal dispute with Cohen, in which she sought to be released from an agreement prohibiting her from talking about the alleged affair. Avenatti has bashed Cohen for months on cable television, saying President Trump’s ex-lawyer deserves to go to prison.

President Trump has argued that the payments were not campaign contributions because his own money was used for the payments. In a Monday tweet, President Trump dismissed what Cohen admitted in court, arguing it wasn’t his fault if his lawyer misstepped. “Lawyer’s liability if he made a mistake, not me,” the president wrote on Twitter. “Cohen just trying to get his sentence reduced. WITCH HUNT!”

“Democrats can’t find a Smocking Gun tying the Trump campaign to Russia after James Comey’s testimony. No Smocking Gun…No Collusion.” @FoxNews That’s because there was NO COLLUSION. So now the Dems go to a simple private transaction, wrongly call it a campaign contribution,… — Donald J. Trump (@realDonaldTrump) December 10, 2018

….which it was not (but even if it was, it is only a CIVIL CASE, like Obama’s – but it was done correctly by a lawyer and there would not even be a fine. Lawyer’s liability if he made a mistake, not me). Cohen just trying to get his sentence reduced. WITCH HUNT! — Donald J. Trump (@realDonaldTrump) December 10, 2018

Last week, New York prosecutors urged Pauley to sentence Cohen to a substantial prison term, stating he had failed to fully cooperate and overstated his helpfulness to their ongoing investigation.

Further, the prosecutors requested only a slight reduction to Cohen’s sentence based on his work with the office of special counsel Robert Mueller and other investigators looking into the campaign finance violations in New York.

The White House has not yet issued a statement on Cohen’s sentencing.

The Associated Press contributed to this report.