An emotional Michael Cohen, President Donald Trump's former lawyer and fixer, was sentenced Wednesday to 3 years behind bars for what a Manhattan federal court judge called a “veritable smorgasbord" of criminal conduct, including making secret payments to women who claimed they had affairs with Trump, lying to Congress about the president’s business dealings with Russia and failing to report millions of dollars in income.

Judge William Pauley found Cohen, 52, deserved “a significant term of imprisonment” for crimes that were driven by “personal greed and ambition.”

Cohen appeared to get choked up as he pleaded with the judge for mercy. He told Pauley he was taking “full responsibility” for his actions — but laid much of the blame at the feet of the former boss he once said he'd take a bullet for.

“I have been living in a personal and mental incarceration ever since the day that I accepted the offer to work for a real estate mogul whose business acumen that I deeply admired," Cohen told the judge, saying his blind loyalty to Trump led him to choose “darkness over light.”

Michael Cohen exits the courthouse after his sentencing in New York on Dec. 12, 2018. Shannon Stapleton / Reuters

He noted that Trump had blasted him as being weak on Twitter.

“It was correct but for a much different reason than he was implying. It was because time and time again I felt it was my duty to cover up his dirty deeds," Cohen said. "My weakness can be characterized as a blind loyalty to Donald Trump, and I was weak for not having the strength to question and to refuse his demands."

Since he first pleaded guilty in August, Cohen said Trump "publicly mocks me, calling me a rat and a liar, and insists that the court sentence me to the absolute maximum time in prison."

"I am committed to proving my integrity and ensuring that history will not remember me as the villain of his story."

He appeared to tear up as he apologized to his family and to the people of the United States.

“I am truly sorry and I promise I will be better," he said.

One of the charges Cohen pleaded guilty to, lying to Congress about his dealings concerning a proposed Trump Tower in Moscow, stemmed from special counsel Robert Mueller's probe into the Trump campaign's potential collusion with Russia in the 2016 election. The other eight — involving tax evasion, lying to financial institutions and violating campaign finance laws by hiding payments to a porn star and a Playboy Playmate who claimed they had affairs with were Trump — were brought by prosecutors in the Southern District of New York.

Assistant U.S. Attorney Nicolas Roos urged the judge to hand down a stiff sentence against Cohen, whose crimes "portray a pattern of deception, of brazenness, and of greed." He also said he'd failed to completely cooperate with investigators, despite the guilty plea.

A prosecutor with the Special Counsel's Office, Jeannie Rhee, struck a kinder tone, and told the judge that Cohen had "provided consistent and credible information about core Russia-related issues under investigation" by their office. The former fixer "has provided valuable information, investigative information, to us while taking care and being careful to note what he knows and what he doesn't know," she said.

A sentencing memo filed by Mueller’s office said Cohen had provided federal investigators with information about his contacts with people connected to Trump and the White House.

Cohen lawyer Guy Petrillo argued his client deserved a break for having stood up to the president.

"He came forward to offer evidence against the most powerful person in our country," knowing he would be subjected to a "barrage of attack by the president," Petrillo told the judge, according to NBC New York.

He argued in court papers that Cohen should be spared jail time, while prosecutors said he should get a little less than the approximately five years called for by federal sentencing guidelines.

Pauley sentenced him to a total of 36 months behind bars, and three years of post-release supervision. The judge order him to pay $1.4 million in restitution and forfeit $500,000, while fining him $50,000 for lying to congress. Cohen must turn himself in to start serving his sentence by March 6.

The judge said Cohen deserved some credit for his decision over the summer to admit guilt and cooperate in the Russia probe. In what sounded to be pushback against Trump's criticism of "rats" and "flippers," Pauley said, "Our system of justice would be less robust without the use of cooperating agreements with law enforcement." But, the judge said, Cohen's assistance "does not wipe the slate clean."

"Somewhere along the way Mr. Cohen appears to have lost his moral compass," the judge said. "As a lawyer, Mr. Cohen should have known better."

Cohen's daughter broke down in tears after the judge handed down his sentence, and was comforted by her glum looking father.

After the proceeding, the U.S. Attorney's office in New York revealed it had struck a non-prosecution agreement with National Enquirer publisher AMI earlier this year for its $150,000 payout to one of the alleged Trump mistresses, former Playboy model Karen McDougal.

"As a part of the agreement, AMI admitted that it made the $150,000 payment in concert with a candidate’s presidential campaign, and in order to ensure that the woman did not publicize damaging allegations about the candidate before the 2016 presidential election," prosecutors said. "AMI further admitted that its principal purpose in making the payment was to suppress the woman’s story so as to prevent it from influencing the election."

In court as a spectator for the packed hearing was Michael Avenatti, whose porn star client Stormy Daniels was paid $130,000 to keep quiet about her alleged affair with Trump. He said the "nation owes a sense of gratitude" to the actress for having spoken out about Cohen and Trump.

Trump, who insists the affairs never happened, argued on Twitter earlier this week that the payments to the women were "a simple private transaction," not a campaign contribution. And if it was a prohibited contribution, Trump said, Cohen is the one who should be held responsible.

"Lawyer's liability if he made a mistake, not me," Trump wrote, adding, "Cohen just trying to get his sentence reduced. WITCH HUNT!"

Trump refused to answer questions about Cohen and his "dirty deeds" charge as he was leaving a signing ceremony at the White House later Wednesday.

Daniels, meanwhile, took to Twitter to celebrate the news. She noted that she was performing at a club in North Carolina. "Tonight's strip show will also be a victory dance!" she tweeted.

After the sentencing, Cohen's former lawyer, Lanny Davis, promised that his client would release everything he knows about the president once Mueller completes his investigation.

“That includes any appropriate congressional committee interested in the search for truth and the difference between facts and lies. Mr. Trump's repeated lies cannot contradict stubborn facts,” Davis said in a statement.

Davis later in a phone interview compared Cohen to Richard Nixon's former White House Counsel John Dean, who helped investigators unravel the Watergate cover-up.

“It's just beginning,” he told NBC News.

The charges Cohen pleaded guilty to:

Charges brought by the Southern District:

Count 1-5: Evasion of assessment of income tax liability for pleading guilty to failing to report more than $4 million in income from 2012 through 2016.

Counts 6: False statements to a bank for Cohen pleading guilty to understating debt from his taxi medallion business in the process of applying for a home equity line of credit with a bank.

Count 7: Causing an unlawful corporation contribution for when he pleaded guilty to orchestrating a payment made by American Media to Karen McDougal for her “limited life story”, an allegation that she had an affair with Donald Trump.

Count 8: Excessive campaign contribution for when he pleaded guilty to making an excessive political contribution when he paid adult film actress Stephanie Clifford aka Stormy Daniels $130,000 for her story and silence about Clifford’s alleged affair with Donald Trump.

Charge brought by Robert Mueller