President Donald Trump’s former lawyer, Michael Cohen, was sentenced Wednesday to three years in prison for crimes that included paying to silence women who claimed affairs with Trump after the President’s onetime “fixer” attributed his offenses to “my duty to cover up his dirty deeds.” Cohen’s sentence is the longest imposed to date on anyone connected to the President or stemming from special counsel Robert Mueller’s investigation into Russian interference in the 2016 election. Cohen professed to take “full responsibility” for his actions. “I take full responsibility for each act that I pled guilty to: The personal ones to me and those involving the President of the United States of America,” he said. But Cohen also articulated a fateful trajectory that took him from the day he accepted a job with a “real estate mogul whose business acumen I deeply admired” to “personal and mental incarceration” and an actual prison term caused by “blind loyalty to the man that led me to choose a path of darkness over light.”

“Recently the President tweeted a statement calling me ‘weak’ and it 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.” Cohen’s sentence resulted from two cases. In August, he pleaded guilty in a Manhattan US attorney’s case to two campaign-finance violations tied to payments he made or orchestrated to women during the campaign — adult-film star Stormy Daniels and former Playboy model Karen McDougal — to stay silent about alleged sexual encounters with Trump. Prosecutors have said that in executing the payments, Cohen “acted in coordination with and at the direction of” Trump, who has denied having the affairs with the two women. Cohen also pleaded guilty to five counts of tax fraud and one count of making false statements to a bank. In late November, Cohen was charged in a separate case from the special counsel’s office with one count of lying to Congress about how long discussions involving a proposed Trump Tower in Moscow had extended into the 2016 campaign. On Wednesday, US District Judge William Pauley III sentenced Cohen to 36 months in prison for the case from New York federal prosecutors and two months for the special counsel’s matter; the sentences will be served concurrently. “Mr. Cohen pled guilty to a veritable smorgasbord of fraudulent conduct,” Pauley told the courtroom. While the judge agreed with the special counsel’s office that Cohen should receive some leniency for his efforts to provide information that was valuable to its investigation, Pauley criticized Cohen for his crimes, his lies and his willingness to commit both in his capacity as an attorney. “Our democratic institutions depend on the honesty of our citizenry in dealing with the government,” Pauley said. Pauley also ordered Cohen to pay $1.39 million in restitution, $500,000 in forfeiture and $100,000 in fines. He must report to prison on March 6. As he addressed the court, Cohen was visibly emotional, pausing several times to collect himself. His wife, son and daughter, who appeared in court alongside his elderly parents and in-laws, sobbed through much of the remarks. His father, in a wheelchair, observed the events with his hands clasped at his mouth. ‘Eroded faith in the electoral process’ The cases against Cohen have emerged as one of the most significant threats to date for Trump, with both Cohen and prosecutors having pinned Cohen’s crimes on Trump’s orders, the judge on Wednesday saying Cohen’s election violations “implicate a far more insidious harm” to democracy and Cohen’s attorney comparing the special counsel probe to the inquiry that ultimately toppled President Richard Nixon. In seeking a lighter sentence for his client, Cohen’s attorney, Guy Petrillo, told the court that the special counsel’s office “investigation is of utmost national significance, no less than seen 40 years ago in Watergate.”

Petrillo also sought to convey the stakes of Cohen’s efforts to aid investigators, saying that when Cohen attempted to help the special counsel, “he knew the President might shut down the investigation.”

“He came forward to offer evidence against the most powerful person in our country,” Petrillo said.

But Assistant US Attorney Nicholas Roos told the courtroom that Cohen’s campaign finance crimes carried a “tremendous societal cost.”

“In committing these crimes, Mr. Cohen has eroded faith in the electoral process and compromised the rule of law,” Roos said.

Wednesday’s events also brought an unexpected dose of potential peril for the President.

Moments after Cohen’s sentencing, the Manhattan US attorney’s office revealed that in September it had reached an agreement with American Media Inc., the parent company of the National Enquirer tabloid, in which it will not prosecute the company in exchange for its admission that it participated in the payment Cohen arranged to silence McDougal “in concert with a candidate’s presidential campaign.”

Prosecutors noted that the agreement also requires the company — whose head, longtime Trump ally David Pecker, received immunity from prosecutors in their investigation of Cohen — to “provide cooperation in the future.”

Cooperation with Mueller

Though the Manhattan US Attorney’s office had described Cohen in court filings as minimally helpful to its investigations, the special counsel’s office again stressed to the court on Wednesday that Cohen had provided “helpful” and “valuable” information to its investigation.

“He has told the truth,” special counsel prosecutor Jeannie Rhee told the judge, after acknowledging that Cohen initially lied to her office. The special counsel said in a filing last week that Cohen had told investigators about a set of efforts to communicate between Trump, his associates and the Russian government during the 2016 campaign.

For his part, Cohen vowed on Wednesday that he could continue to try to assist investigators and Cohen adviser Lanny Davis said in a statement after the sentencing that “after Mr. Mueller completes his investigation and issues his final report, I look forward to assisting Michael to state publicly all he knows about Mr. Trump.”

Several senior Trump officials have pleaded guilty in the special counsel’s investigation, including Trump’s former national security adviser Michael Flynn, former campaign chairman Paul Manafort and former campaign adviser George Papadopoulos, but none were as close to the President for as long as Cohen.