NEW YORK (Reuters) - President Donald Trump’s former personal lawyer Michael Cohen was sentenced to three years in prison on Wednesday for crimes including orchestrating hush payments to women in violation of campaign laws before the 2016 election, and he promised to keep cooperating with the U.S. government against his former boss.

The sentence, which capped a stunning about-face by a lawyer who once vowed to “take a bullet” for Trump, was handed down by a judge in New York on the same day as news that the publisher of the National Enquirer tabloid had struck a deal with prosecutors to avoid charges over its role in one of two hush payments involving Trump.

The publisher admitted the payment was aimed at influencing the 2016 election, contradicting Trump’s statements.

The twin developments highlighted the growing political and legal risks for Trump from a months-long investigation into the payments by federal prosecutors. Some legal experts said Trump could be charged after leaving office. Justice Department policy is not to indict a sitting president.

“These prosecutors have charged or reached agreement with everyone involved in this process save one notable exception,” said Jonathan Turley, a law professor at George Washington University. “It seems likely that this effort is directed at building a larger case against Donald Trump.”

Cohen had said in a guilty plea in August that he was directed by Trump to arrange a payment to Playboy model Karen McDougal, and personally pay adult-film star Stormy Daniels. Prosecutors in New York confirmed last week in a court filing that they believed the president ordered the payments to protect his campaign.

Trump has denied the affairs and argues the payments to the two women were not campaign contributions. “If it were, it’s only civil, and even if it’s only civil, there was no violation based on what we did,” Trump said in an interview on Tuesday.

“From the president’s point of view, it was to protect his family,” Trump’s lawyer, Rudy Giuliani, told Reuters.

In the Manhattan courtroom, Cohen told U.S. District Judge William Pauley that “blind loyalty” led him to cover up for Trump. Cohen said he was ready to provide “as much information as I truthfully possess” on the president.

Slideshow ( 11 images )

“I am committed to proving my integrity and ensuring that history will not remember me as the villain of his story,” Cohen said, choking up at times while giving his statement. “I am truly sorry and I promise I will be better.”

Pauley sentenced Cohen to three years for the payments, and unrelated crimes of tax evasion and misleading banks. He gave Cohen two months for lying to Congress about a proposed Trump Tower project in Russia. The judge said the two terms would run simultaneously and he set March 6 for Cohen’s surrender.

While the sentence was a modest reduction from the four to five years recommended under federal guidelines, Pauley described Cohen’s crimes as a “smorgasbord of fraudulent conduct” marked by deception and “motivated by personal greed.” He ordered Cohen to forfeit $500,000 and pay restitution of nearly $1.4 million.

Cohen, 52, walked into court with his wife, son and daughter amid a crowd of photographers and reporters. His 23-year-old daughter, Samantha, and 19-year-old son, Jake, both wept silently in the courtroom, the son wiping his eyes with his jacket sleeve.

Cohen’s father, Maurice, a Holocaust survivor who helped convince his son to cooperate with prosecutors against Trump, showed little emotion during the hearing but later told reporters: “My heart is ripped.”

‘DIRTY DEEDS’

Pauley sentenced Cohen for two cases - one involving the financial crimes prosecuted by attorneys in the Southern District of New York and the other for lying to Congress brought by Special Counsel Robert Mueller. The Special Counsel is investigating Russia’s role in the 2016 election and possible coordination between Trump’s campaign and Moscow. Russia denies U.S. allegations of election interference and Trump denies collusion.

Prosecutors have said Cohen, just before the November 2016 election, paid Daniels $130,000 and helped arrange the $150,000 payment to McDougal so the women would keep quiet. Federal law requires that the contribution of “anything of value” to a campaign must be disclosed, and an individual donation cannot exceed $2,700.

Slideshow ( 11 images )

“It was my own weakness and a blind loyalty to this man that led me to choose a path of darkness over light,” Cohen told the judge during the sentencing hearing, referring to Trump.

“I felt it was my duty to cover up his own dirty deeds,” Cohen added.

The Mueller investigation represents a threat to Trump’s presidency. Mueller, who also is examining whether the president has unlawfully sought to obstruct the probe, has secured guilty pleas from several former Trump aides including his former campaign chairman and national security adviser, and has indicted several Russia individuals and entities.

One of Mueller’s prosecutors praised Cohen’s cooperation, arguing it should be a mitigating factor in his defense.

“He has provided valuable information, investigative information, to us,” attorney Jeannie Rhee told the judge.

‘MOST POWERFUL PERSON’

Cohen’s lawyer likened the political storm that engulfed his client to Watergate, the 1970’s scandal in which the testimony of White House counsel John Dean helped bring down the Nixon presidency, as a way of emphasizing the pressures he faced.

“He came forward to offer evidence against the most powerful person in the country,” Guy Petrillo told the court in a bid for leniency.

Lanny Davis, a lawyer who is advising Cohen on his media strategy, said his client wanted to testify in front of Congress after Mueller completes his investigation and issues a report, which is expected in the coming months.

“I look forward to assisting Michael to state publicly all he knows about Mr. Trump - and that includes any appropriate congressional committee interested in the search for truth and the difference between facts and lies,” Davis said in a statement.

Cohen was part of Trump’s inner circle who in the past called himself the president’s “fixer.” After Cohen pleaded guilty to the Mueller charges on Nov. 29, Trump called his former lawyer a liar, “a weak person and not a very smart person.”

Michael Avenatti, Daniels’ lawyer, attended the sentencing and told reporters outside the courthouse, “Michael Cohen is neither a hero nor a patriot. He lied for months about his conduct. ... Michael Cohen was sentenced today, President Trump is next.”

Trump has accused Mueller’s team of pressuring his former aides to lie about him, his campaign and his business dealings.