The sentence was in line with what federal prosecutors asked for. Sentencing guidelines called for around four to five years behind bars, and prosecutors asked in court papers that Cohen be given only a slight break.
U.S. District Judge William H. Pauley III said Cohen deserved modest credit for his decision over the summer to admit guilt and cooperate in a federal investigation of efforts by Russians to influence the presidential election, but his 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 told the judge just before he was sentenced that loyalty to Trump led him astray.
"It was my blind loyalty to this man that led me to take a path of darkness instead of light," he said. "I felt it was my duty to cover up his dirty deeds."
Cohen's lawyers had argued for leniency, saying he decided to cooperate with investigators rather than hold out for a possible pardon.
"He came forward to offer evidence against the most powerful person in our country," Cohen's lawyer, Guy Petrillo, told the judge during the hearing.
Cohen, 52, pleaded guilty in August to evading $1.4 million in taxes related to his personal businesses. In the part of the case with greater political repercussions, he also admitted breaking campaign finance laws in arranging payments in the waning days of the 2016 election to porn star Stormy Daniels and Playboy model Karen McDougal, both of whom said they had sexual encounters with Trump.
Cohen became the first - and so far, only - member of Trump's circle during two years of investigations to go into open court and implicate the president in a crime, though whether a president can be prosecuted is a matter of legal dispute.
Last month, Cohen also pleaded guilty to lying to Congress about Trump's business dealings in Russia. He admitted hiding the fact that he was negotiating a proposal to build a Trump skyscraper in Moscow well into the presidential campaign. He said he lied out of devotion to Trump, who had insisted during the campaign that he had no business ties whatsoever to Russia.
The sentence was the culmination of a spectacular rise and fast fall of a lawyer who attached himself to the fortunes of his biggest client, helped him get elected president, then turned on him, cooperating with two interconnected investigations: one run by federal prosecutors in New York, the other by special counsel Robert Mueller, who is looking into Russian efforts to influence the race for the White House.
At the sentencing hearing, a prosecutor in Mueller's office, Jeannie Rhee, said Cohen has "sought to tell us the truth and that is of the utmost value to us."
"He has provided consistent and credible information about core Russia-related issues under investigation," she said without elaborating.
It remains to be seen how much damage Cohen's cooperation will do to Trump. Legal experts said Cohen could get his sentence reduced if he strikes a deal with prosecutors to tell them more.
The defense team said Cohen's tax crimes were unsophisticated, and his campaign violations and lies to lawmakers were motivated by overenthusiasm for Trump, rather than any nefarious intent.
But the New York-based prosecutors who handled the case had urged the judge to sentence Cohen to a substantial prison term and said he failed to fully cooperate with investigators.
Assistant U.S. Attorney Nicolas Roos said Cohen's crimes showed a "pattern of deceit, brazenness and greed."
He called for a sentence that sends a message that "even powerful, privileged individuals cannot violate these laws with impunity."
In their court filing, the prosecutors left no doubt that they believe Cohen arranged the hush-money payments at Trump's direction, saying the maneuver was part of an effort to "influence the election from the shadows."
Trump, who insists the affairs never happened, argued on Twitter 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 had repeatedly called for a tough sentence for Cohen, whom he labeled a liar.
Cohen has had at least seven meetings with Mueller's team, which said in court papers that Cohen provided "relevant and useful" information about attempts by Russian figures to influence Trump's campaign.
In the hush-money case, prosecutors said, Cohen arranged for the parent company of the National Enquirer to pay $150,000 to McDougal. He also paid $130,000 to Daniels and was reimbursed by Trump's business empire. Prosecutors said the McDougal payment violated federal law against corporate campaign contributions, while the money that went to Daniels exceeded the $2,700 limit on campaign donations.