A weepy Michael Cohen was sentenced Wednesday to three years in prison for a “veritable smorgasbord” of crimes — but not before President Trump’s former fixer accused his ex-boss of corrupting him.

During a plea for mercy in Manhattan federal court, Cohen — who once vowed to “take a bullet for the president” but later cooperated with special counsel Robert Mueller — said his “blind loyalty” to Trump had “led me to chose a path of darkness over light.

“Recently, the president tweeted a statement calling me weak, and he was correct, but for a much different reason than he was implying,” Cohen said.

“It was because time and time again I felt it was my duty to cover up his dirty deeds rather than to listen to my own inner voice and my moral compass.”

Trump — who has repeatedly accused Cohen of lying to prosecutors and the court in a bid for leniency — ignored shouted questions from reporters about Cohen’s sentencing during an afternoon ceremony at the White House.

Cohen lawyer Lanny Davis later said his client is willing to testify before “any appropriate congressional committee interested in the search for truth” about what he called Trump’s “misconduct over the years.”

Cohen, 52, choked up at one point during his hourlong sentencing when his lawyer praised his devotion to friends and also broke down in tears as he discussed his family’s suffering as a result of his many misdeeds.

He shook his head and shut his eyes upon learning his fate, while his adult daughter, Samantha Cohen, gasped and burst into tears behind him.

Cohen has until March 6 to report to prison. He was also ordered to pay $1.39 million in restitution to the IRS, $500,000 in forfeitures and $100,000 in fines.

Under federal guidelines, Cohen faced more than five years for his August guilty plea to crimes that included violating campaign-finance laws during the 2016 presidential race.

As part of a case brought by Manhattan federal prosecutors, Cohen admitted arranging ­pre-election hush-money payoffs to porn star Stormy Daniels and former Playboy Playmate Karen McDougal, who both claim to have had affairs with Trump.

Cohen didn’t have a cooperation deal at the time, but he began spilling his guts anyway and later struck a deal with Mueller.

Under terms of that pact, he pleaded guilty last month to lying to Congress about his efforts during the presidential campaign to seek approvals and financing from the Russian government for a Trump development project in Moscow.

Cohen has claimed that Trump directed him to silence Daniels and McDougal — an allegation adopted by prosecutors — and he also said he had “more extensive communications” with Trump about the Russia deal than he told lawmakers.

Cohen described “living in a personal and mental incarceration ever since the fateful day that I accepted the offer to work for a famous real-estate mogul whose business acumen I truly admired.”

“In fact, I now know that there is little to be admired,” he said, referring to Trump.

Judge William Pauley III said Cohen — who also pleaded guilty to tax evasion — had committed a “veritable smorgasbord of illegal conduct,” even though “as a lawyer, Mr. Cohen should have known better.”

“While Mr. Cohen has taken steps to mitigate his criminal conduct by pleading guilty and volunteering useful information to prosecutors, that does not wipe the slate clean,” Pauley said.

Earlier in the proceeding, one of Mueller’s prosecutors, Jeannie Rhee, told Pauley that Cohen had “repeated the false statements” he made to Congress during his first voluntary meeting with the Mueller team in July, but came clean during a second sit-down in September.

“He has provided our office with credible and reliable information about core Russia-related issues under investigation and within the purview of the Special Counsel’s Office,” she said.

Rhee was vague on the details, however, citing “our ongoing investigation.”

Manhattan federal prosecutor Nicolas Roos urged Pauley to impose a “substantial custodial sentence,” noting that in addition to the hush-money scam, Cohen “quite brazenly stole millions of dollars of income from the IRS.”

Taken together, Roos said, “Mr. Cohen has eroded faith in the electoral process and compromised the rule of law.”

Defense lawyer Guy Petrillo argued for “a full consideration of mercy,” praising Cohen’s “courage” and saying his decision to help prosecutors was “importantly different” from most.

Cohen, who’s free on $500,000 bond, said nothing as he left the courthouse and was driven off in a black SUV.